---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is Catalan_Interpretations_Drawing_Routines_Package.shar.txt, a shell archive (produced by GNU sharutils 4.9).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `#!/bin/sh' line above, then type `sh FILE'.
#
lock_dir=_sh05410
# Made on 2011-06-17 22:59 EEST by <http://oeis.org/wiki/User:Antti_Karttunen>.
# Source directory was `/home/hacklab/Downloads/Kartun/fps-1.0'.
#
# Existing files will *not* be overwritten, unless `-c' is specified.
# This format requires very little intelligence at unshar time.
# "if test", "echo", "mkdir", and "sed" may be needed.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   1973 -rw-r--r-- AAREADME.txt
#  50798 -rw-r--r-- Catalan_Interpretations_FPS_drawing_routines.scm
#  22052 -rw-r--r-- Catalan_Interpretations_conversion_functions.scm
#  11796 -rw-r--r-- a014486.sxp
#    948 -rw-r--r-- a057161.sxp
#    941 -rw-r--r-- a057501.sxp
#   2489 -rw-r--r-- a057546.sxp
#   1004 -rw-r--r-- a069771.sxp
#  12515 -rw-r--r-- a069771_upto7.sxp
#    993 -rw-r--r-- a069772.sxp
#   4552 -rw-r--r-- a071661.sxp
#   4853 -rw-r--r-- a079442.sxp
#   1661 -rw-r--r-- a080070.sxp
#    274 -rw-r--r-- a080120.sxp
#   2623 -rw-r--r-- a080974.sxp
#
echo=echo
shar_tty= shar_n= shar_c='
'
if test ! -d ${lock_dir} ; then :
else ${echo} "lock directory ${lock_dir} exists"
     exit 1
fi
if mkdir ${lock_dir} ; then :
else ${echo} "failed to create ${lock_dir} lock directory"
     exit 1
fi
# ============= AAREADME.txt ==============
if test -f 'AAREADME.txt' && test "$first_param" != -c; then
${echo} "x - SKIPPING AAREADME.txt (file already exists)"
else
${echo} "x - extracting AAREADME.txt (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'AAREADME.txt' &&
X
XHow to proceed?
X
XFirst, get scsh (Scheme Shell) which can be found at http://www.scsh.net/
Xor simply, if you are using Ubuntu, by giving a shell-command:
Xsudo apt-get install scsh
X
XThe code given here has been tested to work at least under the version 0.6.7,
Xreleased May 16, 2006, but it is known to have worked also under earlier
Xreleases, such as 0.6.1.
X
XThen get Wandy Sae-Tan's and Olin Shiver's FPS (Functional PostScript)
Xlibrary from http://www.scsh.net/resources/fps.html
X(This page is also archived as:
X  http://web.archive.org/web/20080925094422/http://www.scsh.net/resources/fps.html
X)
X
XSpecifically, the tar-ball of the library itself:
X  http://ftp.scsh.net/pub/scsh/contrib/fps/fps-1.0.tar.gz
X
Xand the associated patch:
X  http://ftp.scsh.net/pub/scsh/contrib/fps/fps-1.0-patch-for-scsh-0.5.3
X
X(Neither the latter two files nor
X http://ftp.scsh.net/pub/scsh/0.6/scsh-0.6.7.tar.gz
Xare yet archived by Internet Archive as of today, June 17 2011,
Xbut we are waiting...)
X
XUnpack the library as:
X
X  tar xvfz fps-1.0.tar.gz
X
Xand then apply the patch (staying in the same directory where you issued
Xthe tar xvfz command, i.e. one directory above fps-1.0):
X
X  patch -p0 < fps-1.0-patch-for-scsh-0.5.3
X
XThis should output the following four lines of text:
Xpatching file fps-1.0/fps-examples.scm
Xpatching file fps-1.0/fps.afm.scm
Xpatching file fps-1.0/fps.glyph.scm
Xpatching file fps-1.0/fps.scm
X
XUnpack this shar-archive for example with command:
X
X  unshar Catalan_Interpretations_Drawing_Routines_Package.shar.txt
X
Xand copy its contents to _THAT SAME fps-1.0 DIRECTORY_ (yeah!),
Xand then proceed as explained in the comments given at the
Xfront of Catalan_Interpretations_FPS_drawing_routines.scm module.
X
XIf you encounter problems, please contact me at:
X
X                               <my_firstname>.<my_surname>@gmail.com
X
X                               Yours,
X
X                               Antti Karttunen
X                               Helsinki, June 17 2011.
X
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of AAREADME.txt failed"
fi
fi
# ============= Catalan_Interpretations_FPS_drawing_routines.scm ==============
if test -f 'Catalan_Interpretations_FPS_drawing_routines.scm' && test "$first_param" != -c; then
${echo} "x - SKIPPING Catalan_Interpretations_FPS_drawing_routines.scm (file already exists)"
else
${echo} "x - extracting Catalan_Interpretations_FPS_drawing_routines.scm (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'Catalan_Interpretations_FPS_drawing_routines.scm' &&
X
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;                                                                          ;;
X;;         Catalan_Interpretations_FPS_drawing_routines.scm                 ;;
X;;                                                                          ;;
X;; Functions for drawing some combinatorial interpretations of Catalan      ;;
X;; numbers with the help of Olin Shivers' and Wandy Sae-Tan's FPS           ;;
X;; (Functional PostScript) library.                                         ;;
X;;                                                                          ;;
X;; This Scheme-code is Copyright (C) 2002-2011 by Antti Karttunen           ;;
X;; (E-mail: <my_firstname>.<my_surname>@gmail.com) and is placed under      ;;
X;;              The OEIS Contributor's License Agreement                    ;;
X;; (see: http://oeis.org/wiki/The_OEIS_Contributor%27s_License_Agreement )  ;;
X;; (More specifically, revision dated 21:40, 1 April 2010, available as:)   ;;
X;; http://oeis.org/w/index.php?title=The_OEIS_Contributor%27s_License_Agreement&oldid=1388581
X;;                                                                          ;;
X;;                                                                          ;;
X;;                                                                          ;;
X;; For an older version of this module, see URL:                            ;;
X;; http://web.archive.org/web/20050827072848/http://ndirty.cute.fi/~karttu/matikka/Nekomorphisms/gato-fps.scm
X;;                                                                          ;;
X;; For the current version, see under:                                      ;;
X;; http://oeis.org/wiki/User:Antti_Karttunen                                ;;
X;;                                                                          ;;
X;; Note: this module runs only in scsh (Scheme Shell) and uses              ;;
X;; the FPS (functional PostScript) library by Wandy Sae-Tan and             ;;
X;; Olin Shivers, located at http://www.scsh.net/resources/fps.html          ;;
X;; and also archived under:                                                 ;;
X;; http://wayback.archive.org/web/*/http://www.scsh.net/resources/fps.html  ;;
X;;                                                                          ;;
X;; The latest scsh (Scheme Shell) can be found at http://www.scsh.net/      ;;
X;; (Tested to work at least under the version 0.6.7, released May 16, 2006) ;;
X;;                                                                          ;;
X;; This file last edited June 17 2011 by Antti Karttunen.                   ;;
X;;                                                                          ;;
X;; After unpacking the shar-archive (which includes this source-file and    ;;
X;; a few *.sxp files) to the SAME DIRECTORY fps-1.0 as where the patched    ;;
X;; FPS-library is located, cd there and start scsh as:                      ;;
X;;                                                                          ;;
X;;  % scsh                                                                  ;;
X;;  Welcome to scsh 0.6.7 (R6RS)                                            ;;
X;;  Type ,? for help.                                                       ;;
X;;  > ,config ,load fps-package.scm                                         ;;
X;;  fps-package.scm                                                         ;;
X;;  > ,open fps                                                             ;;
X;;  Load structure fps (y/n)? y                                             ;;
X;;  > ,load Catalan_Interpretations_FPS_drawing_routines.scm                ;;
X;;  Catalan_Interpretations_FPS_drawing_routines.scm                        ;;
X;;  Catalan_Interpretations_conversion_functions.scm                        ;;
X;;  >                                                                       ;;
X;;                                                                          ;;
X;; Use (for example) as:                                                    ;;
X;; (output-sexp-file-as-ps-file "a014486.sxp" "a014486.ps" 12               ;;
X;;  "Page ~A of http://oeis.org/A014486/a014486.pdf" *FIRST-PAGE*)          ;;
X;;                                                                          ;;
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X
X;; The following utility functions are from lstfuns1.scm module:
X;; (load "../Schemuli/lstfuns1.scm") ;; 
X
X
X(define attach! ; Borrowed from Franz lisp, is like destructive cons.
X  (lambda (elem lista)
X     (set-cdr! lista (cons (car lista) (cdr lista)))
X     (set-car! lista elem)
X     lista
X  )
X)
X
X
X(define (copy-tree bt)
X  (cond ((not (pair? bt)) bt)
X        (else (cons (copy-tree (car bt))
X                    (copy-tree (cdr bt)))
X        )
X  )
X)
X
X
X(define (nthcdr n lista)
X  (if (or (zero? n) (null? lista))
X      lista
X      (nthcdr (- n 1) (cdr lista))
X  )
X)
X
X
X(define (count-pars a)
X    (cond ((not (pair? a)) 0)
X          (else (+ 1 (count-pars (car a)) (count-pars (cdr a))))
X    )
X)
X
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X
X;; Load the conversion routines from parenthesizations (sexp's)
X;; to appropriate manifestations of the Catalan's family.
X
X(load "Catalan_Interpretations_conversion_functions.scm")
X
X(define (1+ n) (+ 1 n))
X(define (-1+ n) (- n 1))
X
X(define (post-incr! n-list)
X   (let ((z (car n-list)))
X      (set-car! n-list (1+ z))
X      z
X   )
X)
X
X(define (monus1 n) (if (> n 0) (-1+ n) n))
X
X
X(define (find-max a)
X    (cond ((not (pair? a))
X               (if (number? a) a 0)
X          )
X          (else (max (find-max (car a)) (find-max (cdr a))))
X    )
X)
X
X(define (pin-headed-line pt1 pt2)
X   (compose (line pt1 pt2)
X            (arc pt1 0.5 0 2pi)
X            (arc pt2 0.5 0 2pi)
X   )
X)
X
X(define (pin-headed-pict-line pt1 pt2)
X  (stroke
X      (compose (line pt1 pt2)
X               (arc pt1 0.5 0 2pi)
X;;             (arc pt2 0.5 0 2pi)  ;; Don't draw the lower bullet, as it has been already drawn!
X      )
X  )
X)
X
X(define (pin-headed-pict-line-red pt1 pt2)
X  (stroke
X      (compose (line pt1 pt2)
X               (arc pt1 0.5 0 2pi)
X;;             (arc pt2 0.5 0 2pi)  ;; Don't draw the lower bullet, as it has been already drawn!
X      )
X      (:color (rgb 1 0 0))
X  )
X)
X
X;; Test:
X;; (define pentagon (draw-polygon-triangularization '((() ())) 24 100 300 #f))
X;; (define handshakes (draw-n-chords '((() ())) 24 200 300 #f #f))
X;; (define both (compose pentagon handshakes))
X;; (out both "esim1.ps")
X;; Or:
X;; (define hexadecigon (draw-polygon-triangularization '((() ((()) ()) ((() ()))) (() (()))) 48 100 300 #f))
X;; (define handshakes2 (draw-n-chords '((() ((()) ()) ((() ()))) (() (()))) 48 200 300 #f #f))
X;; (define both2 (compose hexadecigon handshakes2))
X;; (out both2 "esim2.ps")
X;;
X
X
X
X(define (draw-binary-tree sexp ox oy x_displ y_displ diamwidth)
X    (with-attrib ((:line-width (or diamwidth 0.6)) (:line-cap 'round))
X      (translate ox oy
X             (compose
X                (draw-bincordtree
X                    (fill-cordtree-x-coordinates! (construct-coordinate-tree sexp) x_displ #f)
X                    0 0 y_displ
X                )
X             )
X       )
X    )
X)
X
X
X(define (draw-uncontracted-binary-tree sexp ox oy x_displ y_displ diamwidth)
X    (with-attrib ((:line-width (or diamwidth 0.6)) (:line-cap 'round))
X      (translate ox oy
X             (compose
X                (draw-bincordtree
X                    (fill-cordtree-x-coordinates! (construct-coordinate-tree sexp) x_displ #t)
X                    0 0 y_displ
X                )
X             )
X       )
X    )
X)
X
X
X(define (draw-n-ary-tree sexp ox oy x_displ y_displ diamwidth)
X    (with-attrib ((:line-width (or diamwidth 0.6)) (:line-cap 'round))
X      (translate ox oy
X             (compose
X                (draw-cordtree
X                    (normalize-root-to-zero-and-scale! (p->tree-x-coordinates sexp) x_displ)
X                    0 0 y_displ
X                )
X             )
X       )
X    )
X)
X
X
X;;  (fill-cordtree-x-coordinates! (construct-coordinate-tree '((a . (b . c)) . ((d . e) . f))) 1)
X;; --> (((0 . 0)) ((-1 . 0) (1 . 0)) ((-3/2 . -1) (-1/2 . -1) (1/2 . 1) (3/2 . 1)) ((-3/4 . -1/2) (-1/4 . -1/2) (1/4 . 1/2) (3/4 . 1/2)))
X
X;; If the car-side of pair (caar level) can be found at
X;; cdr-side of some pair of the nextlev, then this is an
X;; "internal" edge colored black, otherwise it's a "leaf-edge"
X;; colored red.
X
X(define (draw-one-level-of-bincordtree level nextlev ox oy ny)
X      (let loop ((level level))
X            (cond ((pair? level)
X                    (compose
X                      (cond
X                        ((find (lambda (x) (= (cdr x) (caar level))) nextlev)
X                          (pin-headed-pict-line
X                               (pt (+ ox (caar level)) ny)
X                               (pt (+ ox (cdar level)) oy)
X                          )
X                        )
X                        (else
X                          (pin-headed-pict-line-red
X                               (pt (+ ox (caar level)) ny)
X                               (pt (+ ox (cdar level)) oy)
X                          )
X                        )
X                      )
X                      (loop (cdr level))
X                    )
X                  )
X                  (else the-empty-pict)
X            )
X      )
X)
X
X;; Draw from top to bottom, because the result is nicer.
X
X(define (draw-bincordtree cot ox oy y_displ)
X  (let ((revcot (reverse! (cdr cot))))
X    (compose
X      (let loop ((ct revcot) (nextlev '())
X                 (y (+ oy (* (length revcot) y_displ)))
X                )
X             (cond ((pair? ct)
X                     (compose
X                       (draw-one-level-of-bincordtree
X                                      (car ct)
X                                      nextlev
X                                      ox (- y y_displ) y
X                       )
X                       (loop (cdr ct) (car ct) (- y y_displ))
X                     )
X                   )
X                   (else the-empty-pict)
X             )
X      )
X      ((if (eq? (length cot) 1)
X           pin-headed-pict-line-red ;; For empty trees a red root dot
X           pin-headed-pict-line     ;; For others a black one.
X       )
X           (pt (+ ox (caaar cot)) (+ oy (cdaar cot)))
X           (pt (+ ox (caaar cot)) (+ oy (cdaar cot)))
X      )
X    ) ;; compose
X  )
X)
X
X
X
X(define (draw-bincordtree-bit-older cot ox oy y_displ)
X;;(stroke  ;; Already stroked, now composing pict's, not paths!
X    (compose
X      ((if (eq? (length cot) 1)
X           pin-headed-pict-line ;; For empty trees a black root dot
X           pin-headed-pict-line-red ;; For others a red one.
X       )
X           (pt (+ ox (caaar cot)) (+ oy (cdaar cot)))
X           (pt (+ ox (caaar cot)) (+ oy (cdaar cot)))
X      )
X      (let loop ((ct (cdr cot)) (y oy))
X             (cond ((pair? ct)
X                     (compose
X                       (draw-one-level-of-bincordtree
X                                      (car ct)
X                                      (if (pair? (cdr ct)) (cadr ct) '())
X                                      ox y (+ y y_displ)
X                       )
X                       (loop (cdr ct) (+ y y_displ))
X                     )
X                   )
X                   (else the-empty-pict)
X             )
X       )
X    ) ;; compose
X;;)
X)
X
X;; (normalize-root-to-zero-and-scale! (p->tree-x-coordinates '(()((())()))) 12)
X;; --> (0 (-9) (9 (3 (3)) (15)))
X
X(define (draw-cordtree ct ox oy y_displ)
X  (stroke
X    (let recurse ((ct ct) (y oy) (prev_y oy) (prev_x (car ct)))
X       (cond ((pair? ct)
X               (compose
X                 (cond ((number? (car ct)) ;; At the beginning of branch-list?
X                         (compose
X                            (pin-headed-line
X                               (pt (+ ox prev_x) prev_y)
X                               (pt (+ ox (car ct)) y)
X                            )
X                            (recurse (cdr ct) (+ y y_displ) y (car ct)) ;; Start scanning sub-branches.
X                         )
X                       )
X                       (else ;; Still scanning the sub-branches.
X                         (compose
X                            (recurse (car ct) y prev_y prev_x) ;; Draw this branch.
X                            (recurse (cdr ct) y prev_y prev_x) ;; Continue sub-branches.
X                         )
X                       )
X                  ) ;; cond
X               ) ;; compose
X             )
X             (else the-empty-path)
X       )
X    )
X  )
X)
X
X
X(define (width-for-digit-list digit-list scale)
X    (let* ((font-used (font "Courier" scale))
X           (str-glyph (simple-string->glyphpath font-used
X                        (string-concatenate (map (lambda (x)
X                                                   (format #f "~A"
X                                                        (cond ((< x 10) x)
X                                                              (else (ascii->char (+ x 55))) ;; 'A' = 65.
X                                                        )
X                                                   )
X                                                 )
X                                                 digit-list
X                                            )
X                        )
X                      )
X           )
X           (max-pt (bounding-box:max (bounding-box str-glyph)))
X           (str-width (pt:x max-pt))
X          )
X       str-width
X    )
X)
X
X
X(define (draw-digit-list digit-list ox oy scale)
X    (let* ((font-used (font "Courier" scale))
X           (Lword (simple-string->glyphpath font-used
X                    (string-concatenate (map (lambda (x)
X                                                (format #f "~A"
X                                                        (cond ((< x 10) x)
X                                                              (else (ascii->char (+ x 55))) ;; 'A' = 65.
X                                                        )
X                                                )
X                                             )
X                                             digit-list
X                                        )
X                    )
X                  )
X           )
X          )
X       (translate ox oy (stroke Lword))
X    )
X)
X
X
X
X;; Show also the last zero explicitly!
X(define (draw-Lukasiewicz-word sexp ox oy scale)
X        (draw-digit-list (append! (p->Lw sexp) (list 0)) ox oy scale)
X)
X
X(define (draw-A071158-word sexp ox oy scale)
X        (draw-digit-list (if (null? sexp) (list 0) (sexp->A071158 sexp)) ox oy scale)
X)
X
X
X(define (draw-cardinal-number cardno ox oy scale)
X    (let* ((font-used (font "Courier" scale))
X           (ostr (simple-string->glyphpath font-used (format #f "~A" cardno)))
X          )
X       (translate ox oy (stroke ostr))
X    )
X)
X
X(define (draw-cardinal-number-right cardno ox oy scale)
X    (let* ((font-used (font "Courier" scale))
X           (ostr (simple-string->glyphpath font-used (format #f "~A" cardno)))
X           (max-pt (bounding-box:max (bounding-box ostr)))
X           (str-width (pt:x max-pt))
X          )
X       (translate (- ox str-width) oy (stroke ostr))
X    )
X)
X
X(define (draw-ordinal-number ordno ox oy scale)
X    (let* ((font-used (font "Courier" scale))
X           (ostr (simple-string->glyphpath font-used (format #f "~A." ordno)))
X          )
X       (translate ox oy (stroke ostr))
X    )
X)
X
X
X(define (draw-parenthesization-ugly sexp ox oy scale)
X  (with-attrib ((:line-width 0.6) (:line-cap 'round))
X    (let* ((x_now (list ox))
X           (font-used (font "Courier" scale))
X           (pars (simple-string->glyphpath font-used (format #f "~S" sexp)))
X          )
X      (translate ox oy (stroke pars))
X    )
X  )
X)
X
X
X;; Well, we do violence to the kerning here, but we want
X;; the parentheses to be exactly in same x-positions as
X;; the corresponding digits of TBBS, and slopes of the Dyck path.
X(define (draw-parenthesization sexp ox oy scale binexp-also?)
X  (with-attrib ((:line-width 0.6) (:line-cap 'round))
X    (let* ((x_now (list ox)) ;; Perfaito?
X           (s 0)
X           (letrsize (* 2 scale))
X           (num-y-level oy)
X           (par-y-level (if binexp-also? (- oy letrsize) oy))
X           (font-used (font "Courier" letrsize))
X           (lpar (char->glyphpath font-used #\())
X           (rpar (char->glyphpath font-used #\)))
X           (zero (char->glyphpath font-used #\0))
X           (one  (char->glyphpath font-used #\1))
X          )
X     (compose
X      (let recurse ((p sexp))
X        (cond ((not (null? p))
X                  (compose (translate (car x_now) par-y-level (stroke lpar))
X                           (if binexp-also?
X                               (translate (car x_now) num-y-level (stroke one))
X                               the-empty-pict
X                           )
X                           (begin
X                               (set! s (+ (* 2 s) 1))
X                               (set-car! x_now (+ (car x_now) scale))
X                               (recurse (car p)) ;; Recurse between.
X                           )
X                           (translate (car x_now) par-y-level (stroke rpar))
X                           (if binexp-also?
X                               (translate (car x_now) num-y-level (stroke zero))
X                               the-empty-pict
X                           )
X                           (begin
X                               (set! s (+ (* 2 s) 0))
X                               (set-car! x_now (+ (car x_now) scale))
X                               (recurse (cdr p)) ;; Recurse the rest.
X                           )
X                  )
X              )
X              (else the-empty-pict)
X        )
X      ) ;; let recurse
X      (cond (binexp-also?
X              (let* ((str (format #f "~A" s))
X                     (str-glyph (simple-string->glyphpath font-used str))
X                     (max-pt (bounding-box:max (bounding-box str-glyph)))
X                     (str-width  (pt:x max-pt))
X                    )
X                 (translate
X                            (- ox (+ (* 2 scale) str-width)) ;; Was: (- ox (* scale (+ 2 (string-length str))))
X                            num-y-level
X                            (stroke str-glyph)
X                 )
X              )
X            )
X            (else the-empty-pict)
X      ) ;; let recurse
X     ) ;; compose
X    ) ;; let*
X  ) ;;
X)
X
X(define (parenthesization->binexp sexp)
X  (let ((s 0))
X    (let recurse ((p sexp))
X       (cond ((not (null? p))
X                 (set! s (+ (* 2 s) 1))
X                 (recurse (car p)) ;; Recurse between.
X                 (set! s (+ (* 2 s) 0))
X                 (recurse (cdr p)) ;; Recurse the rest.
X             )
X       )
X    ) ;; let recurse
X    s
X  )
X)
X
X
X(define (draw-decimal-tbbs sexp ox oy scale)
X  (with-attrib ((:line-width 0.6) (:line-cap 'round))
X      (compose
X         (let* ((str (format #f "~A" (parenthesization->binexp sexp)))
X                (letrsize scale)
X                (font-used (font "Courier" letrsize))
X                (str-glyph (simple-string->glyphpath font-used str))
X                (max-pt (bounding-box:max (bounding-box str-glyph)))
X                (str-width  (pt:x max-pt))
X               )
X                 (translate
X                            (- ox str-width)
X                            oy
X                            (stroke str-glyph)
X                 )
X         ) ;; let*
X      ) ;; compose
X  ) ;;
X)
X
X
X(define (draw-dyck-path sexp ox oy scale linewidth)
X  (with-attrib ((:line-width (or linewidth 0.6)) (:line-cap 'round))
X    (let ((x_now (list ox)))
X       (stroke
X         (let recurse ((s sexp) (level 0))
X            (cond ((not (null? s))
X                    (compose
X                      (pin-headed-line ;; Upward slope /
X                          (pt (car x_now) (+ oy (* scale level)))
X                          (pt (+ (car x_now) scale) (+ oy (* scale (+ 1 level))))
X                      )
X                      (begin (set-car! x_now (+ (car x_now) scale))
X                             (recurse (car s) (+ level 1)) ;; Recurse between.
X                      )
X                      (pin-headed-line ;; Downward slope \
X                          (pt (car x_now) (+ oy (* scale (+ 1 level))))
X                          (pt (+ (car x_now) scale) (+ oy (* scale level)))
X                      )
X                      (begin (set-car! x_now (+ (car x_now) scale))
X                             (recurse (cdr s) level) ;; Recurse the rest.
X                      )
X                    ) ;; compose
X                  )
X                  ((zero? level) ;; We want one dot . for an empty path ().
X                      (pin-headed-line (pt (car x_now) oy) (pt (car x_now) oy))
X                  )
X                  (else the-empty-path)
X            )
X         )
X       ) ;; stroke
X    ) ;; let
X  ) ;; with-attrib
X)
X
X;; Draw a non-crossing Murasaki-diagram:
X(define (draw-rr-diagram sexp x y scale linewidth height-overdrive?)
X (let* ((height (or height-overdrive? (* scale (max 3 (count-pars sexp)))))
X        (y (+ y height))
X       )
X  (with-attrib ((:line-width (or linewidth 0.6)) (:line-cap 'round))
X    (stroke
X      (let loop ((partitions (add-depths-to-rr-parts! (sexp->pp-qq-rr-cycles sexp))))
X            (cond ((pair? partitions)
X                     (let* ((part (cdar partitions))
X                            (depth (caar partitions))
X                            (leftmost (car part))
X                            (rightmost (car (last-pair part)))
X                           )
X                       (compose ;; First the horizontal line: (Just a dot if leftmost = rightmost)
X                            (line (pt (+ x (* scale leftmost)) (- y (* scale depth)))
X                                  (pt (+ x (* scale rightmost)) (- y (* scale depth)))
X                            )
X                            (let inloop ((part part)) ;; then the vertical lines.
X                                (cond ((null? part) the-empty-path)
X                                      (else
X                                          (compose
X                                            (line (pt (+ x (* scale (car part))) (- y (* scale depth)))
X                                                  (pt (+ x (* scale (car part))) (- y height))
X                                            )
X                                            (inloop (cdr part))
X                                          )
X                                      )
X                                )
X                            )
X                            (loop (cdr partitions))
X                       ) ;; compose
X                     )
X                  )
X                  (else the-empty-path)
X            )
X      )
X    )
X  )
X )
X)
X
X(define (draw-polygon-triangularization sexp ox oy radius chordwidth)
X    (draw-chords-with-or-without-circle (bt->pt sexp) radius ox oy #f #f chordwidth #f 0 0 0)
X)
X
X
X(define (draw-n-chords sexp ox oy radius chordwidth perimwidth)
X    (draw-chords-with-or-without-circle (sexp->hs sexp) radius ox oy #t #t chordwidth perimwidth 1 0 0)
X)
X
X(define (draw-qq-chords sexp ox oy radius chordwidth perimwidth)
X    (draw-chords-with-or-without-circle (sexp->pp-qq-rr sexp) radius ox oy #t #f chordwidth perimwidth 0 0 1)
X)
X
X
X
X(define (draw-chords-with-or-without-circle chords radius ox oy circle? curved? chordwidth perim_width r g b)
X   (let ((perimwidth (or perim_width 0.3)))
X    (with-attrib ((:line-width (or chordwidth 0.5)))
X      (translate ox (+ oy radius) ;; According to the bottom, not the center.
X             (compose
X                (draw-chords chords radius curved?)
X                (if circle?
X                    (stroke (arc origin (+ radius perimwidth) 0 2pi)
X                            (:color (rgb r g b))
X                            (:line-width perimwidth)
X                    )
X                    the-empty-pict
X                )
X             )
X       )
X    )
X   )
X)
X
X
X;;
X;; The point 1 is a half-angle clockwise from the angle 3/2 pi
X;; The point 2 is one angle and half clockwise from the angle 3/2 pi
X;; The point n is a half-angle counter-clockwise from the angle 3/2 pi.
X;;
X;;
X;;
X
X;; angle = (3/2 pi + pi/n) - (v * (2pi/n))
X
X(define (compute-vert-angle v n)
X  (let ((a (- (+ (/ (* 3 pi) 2) (/ pi n)) ;; Subtract from the angle of n
X              (* v (/ 2pi n)) ;; ... the v * angle used.
X           )
X       ))
X     (if (< a 0) (+ a 2pi) a) ;; Ensure that it is positive angle.
X  )
X)
X
X
X(define (get-edge-point v n radius)
X  (let ((angle (compute-vert-angle v n)))
X     (pt (* radius (cos angle)) (* radius (sin angle)))
X  )
X)
X
X;; g1 and g2 are angles from the origo to the vertices v1 and v2
X;; respectively.
X;; angle = the mean of the angles g1 and g2, the angle from origo
X;; to antiorigo.
X;; h = height of equilateral triangle whose base is the line segment v1-v2,
X;; and 2h is distance between the origo and the antiorigo
X
X;; The angle between the first and the last vertices is straight down.
X
X(define (draw-anti-arc v1 v2 n radius)
X  (let* ((g1 (compute-vert-angle
X               ((if (eq? (abs (- v1 v2)) (- n 1)) min max) v1 v2) n))
X         (g2 (compute-vert-angle
X               ((if (eq? (abs (- v1 v2)) (- n 1)) max min) v1 v2) n))
X         (h  (* radius (cos (/ pi n))))
X;;       (angle (/ (+ g1 g2) 2)) ;; Doesn't work that way...
X         (angle (compute-vert-angle
X                   (if (eq? (abs (- v1 v2)) (- n 1)) ;; First & the last vert?
X                       (/ 1 2) ;; Then straight down.
X                       (/ (+ v1 v2) 2) ;; Otherwise their average.
X                   )
X                   n
X                )
X         )
X         (antiorigo (pt (* 2 h (cos angle)) (* 2 h (sin angle))))
X        )
X     (arc antiorigo radius (+ pi g1) (+ pi g2))
X  )
X)
X
X
X(define (draw-chords chords radius curved?)
X  (stroke
X    (let ((n (find-max chords)))
X      (let loop ((chords chords))
X            (cond ((and (pair? chords) (pair? (car chords)))
X                    (compose
X                      (cond
X                         ((= (caar chords) (cdar chords)) ;; Point connected only with itself!?
X                            (arc (get-edge-point (caar chords) n radius) 0.5 0 2pi) ;; Then draw a smallish circle.
X                         )
X                         ((and curved?
X                               (> n 2)
X                               (memq (abs (- (caar chords) (cdar chords)))
X                                     (list 1 (- n 1)) ;; Neighbours?
X                               )
X                          )
X                            (draw-anti-arc (caar chords) (cdar chords) n radius)
X                         )
X                         (else ;; A straight line.
X                            (line (get-edge-point (caar chords) n radius)
X                                  (get-edge-point (cdar chords) n radius)
X                            )
X                         )
X                      ) ;; cond
X                      (loop (cdr chords))
X                    ) ;; compose
X                  )
X                  (else the-empty-path)
X            )
X      )
X    )
X  )
X)
X
X
X;; draw-arcs-with-or-without-base: a function for drawing Siteswap-diagrams for
X;; Juggling-patterns, somewhat like the figures 4, 5 and 6 in
X;;
X;; Buhler, Graham et al paper "Juggling Drops and Descents",
X;; Amer. Math. Monthly, 101, (no. 6) 1994, 507 - 519.
X;; which can be seen at:
X;;
X;; http://www.cecm.sfu.ca/organics/papers/buhler/paper/html/node2.html
X;;
X;; arcs: the same syntax as with chords: ((n1 . n2) (n3 . n4) ...)
X;; size: distance between the beats.
X;; baselinewidth: #f if no baseline is requested, otherwise its width.
X;; baselinemargin: margin to the left and right of the beat 1 and max-beat
X
X
X
X(define (draw-arcs-with-or-without-base arcs size ox oy downside? arcwidth base_linewidth baselinemargin r g b)
X   (let ((baselinewidth (or base_linewidth 0.3))
X         (max-beat (find-max arcs))
X        )
X    (with-attrib ((:line-width (or arcwidth 0.5)))
X      (translate (+ ox baselinemargin) oy
X             (compose
X                (draw-arcs arcs max-beat size downside?)
X                (if base_linewidth
X                    (stroke (line (pt (- baselinemargin) 0)
X                                  (pt (+ baselinemargin (* size (- max-beat 1))) 0)
X                            )
X                            (:color (rgb r g b))
X                            (:line-width baselinewidth)
X                    )
X                    the-empty-pict
X                )
X             )
X       )
X    )
X   )
X)
X
X
X(define (draw-arcs arcs max-beat size downside?)
X (stroke
X   (let loop ((arcs arcs))
X      (cond ((and (pair? arcs) (pair? (car arcs)))
X               (compose
X                      (arc (pt (* size (- (/ (+ (caar arcs) (cdar arcs)) 2) 1))
X                               0
X                           )
X                           (* (/ size 2)
X                              (- (max (caar arcs) (cdar arcs))
X                                 (min (caar arcs) (cdar arcs))
X                              )
X                           )
X                           (if downside? pi 0)
X                           (if downside? 2pi pi)
X                      )
X                 (loop (cdr arcs))
X               ) ;; compose
X            )
X            (else the-empty-path)
X      )
X   )
X )
X)
X
X
X;; (outeps (draw-arcs-with-or-without-base '((1 . 5) (2 . 6) (3 . 4) (4 . 8) (5 . 9) (6 . 7) (7 . 11) (8 . 12) (9 . 10)) 20 40 40 #f #f #f 0 0 0 0)  "j441.eps")
X;; (outeps (draw-arcs-with-or-without-base '((1 . 5) (2 . 6) (3 . 4) (4 . 8) (5 . 9) (6 . 7) (7 . 11) (8 . 12) (9 . 10)) 20 40 40 #f #f 0.5 10 0 0 1)  "jb441.eps")
X
X;; 45141 (= 14514): a tennis pattern with shades of 441.
X;; This starts with 441 and then changes to 14514.
X;; (outeps (draw-arcs-with-or-without-base '((1 . 5) (2 . 6) (3 . 4) (4 . 8) (5 . 10) (6 . 7) (7 . 11) (8 . 9) (9 . 13) (10 . 15) (11 . 12) (12 . 16) (13 . 14) (14 . 18) (15 . 20) (16 . 17) (17 . 21) (18 . 19)) 10 10 50 #f #f 1.5 5 1 0 0)  "jb14514.eps")
X
X;; (outeps (draw-arcs-with-or-without-base '((1 . 10) (2 . 5) (3 . 4) (6 . 7) (8 . 9)) 6 0 35 #t #f 0.5 3 1 0 0)  "ob54.eps")
X
X
X(define (out pict filename) (show-w/ps2-text-channel filename pict))
X(define (outeps pict filename) (show-w/ps2-text-channel filename pict (:format "EPS")))
X
X
X(define (read-lists-from infile)
X   (call-with-input-file infile
X      (lambda (inport)
X           (let loop ((sexp (read inport)) (res (list)))
X                 (cond ((eof-object? sexp) (reverse! res))
X                       (else (loop (read inport) (cons sexp res)))
X                 )
X           )
X      )
X   )
X)
X
X
X
X;; The following functions contain some very ugly constants, until I
X;; invent something better...
X
X(define (compose-one-cycle-old sexps radius x_start x_displ y_now)
X   (let loop ((sexps sexps) (x x_start))
X      (cond ((not (null? sexps))
X               (compose
X                   (draw-n-ary-tree (car sexps)  x (car y_now) (/ radius 2) (/ radius 2) #f)
X                   (draw-binary-tree (car sexps) x (- (car y_now) (* 3 radius)) (/ radius 2) (/ radius 2) #f)
X                   (draw-polygon-triangularization (car sexps) x (- (car y_now) (* 6 radius)) radius #f)
X                   (draw-n-chords (car sexps) x (- (car y_now) (* 9 radius)) radius #f #f)
X                   (loop (cdr sexps) (+ x x_displ))
X               )
X            )
X            (else the-empty-pict)
X      )
X   )
X)
X
X;; Some of these interpretations are very Ad Hoc.
X;; It would be better, if we could have format (interpretation various-output-position-et-style-attributes ...)
X;; instead of a simple symbol.
X;; Yes, now we start building something like that.
X
X(define (compose-all-interpretations-for-a-single sexp scale x y interpretations chordwidth perimwidth ordnow)
X  (let ((somewhat-left (* 4 scale))
X        (size (count-pars sexp))
X       )
X    (cond
X      ((not (pair? interpretations)) the-empty-pict)
X      (else
X         (compose
X            (let* ((desc (car interpretations))
X                   (interp-let (if (pair? desc) (car desc) desc))
X                   (centered? (and (pair? desc) (or (memq ':c desc) (memq ':C desc))))
X                   (x_extra_offset (if (and (pair? desc) (pair? (cdr desc)) (number? (cadr desc))) (cadr desc) 0))
X                   (transl_x
X                       (+ x_extra_offset
X                          (cond (centered? (* 0.5 scale size) 0) (else 0))
X                       )
X                   )
X                   (transl_y 0)
X                  )
X              (translate transl_x transl_y
X                (case interp-let
X                   ((()) ;; Nil for padding. Draw nothing, except consume some Y-space.
X                       the-empty-pict
X                   )
X                   ((a) ;; triangulations
X                       (draw-polygon-triangularization sexp x y scale chordwidth)
X                   )
X                   ((d) ;; plane binary trees with 2n+1 vertices
X                       (draw-binary-tree sexp x y (/ scale 2) (/ scale 2) chordwidth)
X                   )
X                   ((dU) ;; plane binary trees with 2n+1 vertices, uncontracted
X                       (draw-uncontracted-binary-tree sexp x y (/ scale 2) (/ scale 2) chordwidth)
X                   )
X                   ((e) ;; plane (general) trees with n+1 vertices
X                       (draw-n-ary-tree sexp x y (/ scale 2) (/ scale 2) chordwidth)
X                   )
X                   ((e+d) ;; plane (general) trees with n+1 vertices, shifted by 0.5 * scale * size points right. + binary trees to their left.
X                     (compose
X                       (translate (* 0.5 scale (count-pars sexp)) 0
X                             (draw-n-ary-tree sexp x y (/ scale 2) (/ scale 2) chordwidth)
X                       )
X                       (draw-binary-tree sexp (- x somewhat-left) y (/ scale 2) (/ scale 2) chordwidth)
X                     )
X                   )
X                   ((i) ;; ordinary Dyck paths
X                       (draw-dyck-path sexp x y (/ scale 2) chordwidth)
X                   )
X                   ((n) ;; non-crossing handshakes at a circular table.
X                       (draw-n-chords sexp x y scale chordwidth perimwidth)
X                   )
X                   ((qq) ;; non-crossing partitions.
X                       (draw-qq-chords sexp x y scale chordwidth perimwidth)
X                   )
X                   ((rr) ;; non-crossing Murasaki-diagrams
X                       (draw-rr-diagram sexp (- x (/ scale 2)) y (/ scale 2) chordwidth #f)
X                   )
X                   ((A071156)
X                       (draw-cardinal-number (sexp->A071156 sexp) x y scale)
X                   )
X                   ((A071158)
X                       (draw-A071158-word sexp x y scale)
X                   )
X                   ((L) ;; Lukasiewicz-words
X                       (draw-Lukasiewicz-word sexp x y scale)
X                   )
X                   ((Td) ;; Totally balanced binary sequences as a decimal number, as in A014486, right-justified.
X                       (draw-decimal-tbbs sexp x y scale)
X                   )
X                   ((Tdsmall) ;; Totally balanced binary sequences as a decimal number, as in A014486, right-justified.
X                       (draw-decimal-tbbs sexp x y (- scale 2)) ;; But with a smaller font. Kludge!
X                   )
X                   ((O) ;; Ordinal numbers... (somewhat a kludge...)
X                       (draw-ordinal-number (post-incr! ordnow) (* 4 scale) y scale)
X                   )
X                   ((S) ;; Size
X                       (draw-cardinal-number (count-pars sexp) (* 4 scale) y scale)
X                   )
X                   ((S*2+1) ;; Size*2 + 1
X                       (draw-cardinal-number (1+ (* 2 (count-pars sexp))) (* 4 scale) y scale)
X                   )
X                   ((P) ;; Parenthesizations
X                       (draw-parenthesization sexp x y (/ scale 2) #f)
X                   )
X                   ((P+T) ;; Parenthesizations + totally balanced binary sequences.
X                       (draw-parenthesization sexp x y (/ scale 2) #t)
X                   )
X                ) ;; case
X              ) ;; translate
X            ) ;; let
X            (compose-all-interpretations-for-a-single sexp scale x (- y (* 3 scale)) (cdr interpretations) chordwidth perimwidth ordnow)
X         ) ;; compose
X      ) ;; else
X    ) ;; cond
X  )
X)
X
X
X
X(define (compose-one-cycle sexps radius x_start x_displ y_now interpretations ordnow)
X   (let loop ((sexps sexps) (x x_start))
X      (cond ((not (null? sexps))
X               (compose (compose-all-interpretations-for-a-single (car sexps) radius x (car y_now) interpretations #f #f ordnow)
X                        (loop (cdr sexps) (+ x x_displ))
X               )
X            )
X            (else the-empty-pict)
X      )
X   )
X)
X
X
X
X(define (compose-one-partition partition radius x_start x_displ y_now y_required interpretations ordnow)
X   (let loop ()
X      (cond ((and (pair? partition) (pair? (cdr partition)) ;; Still something to print?
X                  (> (car y_now) y_required) ;; Still fits in this page?
X             )
X               (compose (compose-one-cycle (cadr partition) radius x_start x_displ y_now interpretations ordnow)
X                        (begin
X                               (set-car! y_now (- (car y_now) y_required))
X                               (delete! (cadr partition) partition)
X                               (loop)
X                        )
X               )
X            )
X            (else the-empty-pict)
X      )
X   )
X)
X
X
X(define (compose-pictures-of-partition lists radius x_start x_displ y_now y_required interpretations ordnow)
X  (let loop () ;; ((lists (cdr lists)))
X      (cond ((and (pair? lists) (pair? (cdr lists)) ;; Still something to print?
X                  (> (car y_now) y_required) ;; Still fits in this page?
X             )
X               (begin
X;; First, insert our "anchor" to the beginning of partition (an integer, in contrast to list structures), if not already there:
X                  (cond ((not (integer? (caadr lists))) (attach! (length (cadr lists)) (cadr lists))))
X                  (compose (compose-one-partition (cadr lists) radius x_start x_displ y_now y_required interpretations ordnow)
X                           (cond ((and (pair? (cadr lists)) (pair? (cdr (cadr lists)))) ;; Still something to print, but no space...
X                                    the-empty-pict
X                                 )
X                                 (else ;; We exhausted this partition
X                                       (delete! (cadr lists) lists)
X                                       (loop)
X                                 )
X                           )
X                  )
X               )
X            )
X            (else the-empty-pict)
X      )
X  )
X)
X
X
X
X;; Use as:
X;; (output-part-file-as-ps-file "a057161.sxp" "a057161.ps" 8 '(a d) #f #f)
X;; (output-part-file-as-ps-file "a057501.sxp" "a057501.ps" 9 '(n i P e L d a) #f #f)
X;; (output-part-file-as-ps-file "a069771.sxp" "a069771.ps" 9 '(n i P e L d) #f #f)
X;; (output-part-file-as-ps-file "a079438.sxp" "a079438.ps" 10 '(i () (e :C) P () () d a n) 60 240)
X;; (output-part-file-as-ps-file "a079442.sxp" "a079442.ps" 10 '(i () (e :C) P () () d a n) 60 140)
X;; (output-part-file-as-ps-file "a080070.sxp" "a080070.ps" 10 '(O i (e :C) d P+T) 140 0)
X;; (output-part-file-as-ps-file "a080120.sxp" "a080120.ps" 10 '(S*2+1 i (e :C) (n :C) P+T L) 140 0)
X;; (output-part-file-as-ps-file "a080263.sxp" "a080263.ps" 8 '(O e (Td +16) () () dU a) 240 240)
X;; (output-part-file-as-ps-file "a080973.sxp" "a080973.ps" 8 '(O e (Tdsmall +200) n) 240 240)
X;; (output-part-file-as-ps-file "a086429.sxp" "a086429.ps" 9 '(n qq rr A071158 A071156 i P) #f #f)
X;; (output-part-file-as-ps-file "a102241.sxp" "a102241.ps" 10 '(O i (e :C) (d -80) P+T) 140 0)
X
X
X(define (output-part-file-as-ps-file infile outfile radius interpretations x_start_overwrite? x_displ_overwrite?)
X   (let* ((lists (read-lists-from infile)) ;; Keep the header all the time. Because this is modified with delete!
X          (y_start_below_header 730)
X          (y_now (list y_start_below_header))
X          (y_required (* 3 radius (+ 1 (length interpretations))))
X          (ordnow (list 0))
X          (outchannel (ps2-text-channel outfile))
X          (format-str (string-append (caar lists) "   --   Page ~A"))
X          (font-used (font "Times-Roman" 10))
X          (x_start (or x_start_overwrite? (* 4 radius)))
X          (x_displ (or x_displ_overwrite? (* 7 radius)))
X         )
X     (let loop ((pageno 1))
X        (cond ((not (null? (cdr lists)))
X                (format #t "Doing page ~S, ordnow=~S, (length lists)=~S, (car lists)=~S, (cadr lists)=~S~%"
X                             pageno ordnow (length lists) (car lists) (cadr lists))
X                (force-output (current-output-port))
X                (show outchannel
X                   (compose
X                      (translate (* 1 radius) (+ (car y_now) 50)
X                         (stroke (simple-string->glyphpath font-used (format #f format-str pageno)))
X                      )
X                      (compose-pictures-of-partition lists radius x_start x_displ y_now y_required interpretations ordnow)
X;;                    (compose-one-instance-per-line! lists outchannel radius (* 8 radius) y_now (* 6 radius))
X                   )
X                )
X                (set-car! y_now y_start_below_header)
X                (loop (+ 1 pageno))
X              )
X        )
X     )
X     (close-channel outchannel)
X   )
X)
X
X
X(define (compose-one-instance-per-line! sexps outchannel radius x_start y_now y_displ)
X   (let loop () ;; (sexps (cdr sexps)))
X      (cond ((and (pair? sexps) (pair? (cdr sexps)) ;; Still something to print?
X                  (> (car y_now) (+ (* 2 radius) y_displ)) ;; Still fits in this page?
X             )
X               (compose
X                   (draw-ordinal-number (car sexps) radius                   (- (car y_now) radius) radius)
X                   (draw-dyck-path   (cadr sexps) x_start                    (car y_now) (/ radius 2) #f)
X                   (draw-parenthesization
X                                     (cadr sexps) x_start                    (- (car y_now) radius) (/ radius 2) #t)
X
X                   (draw-n-chords
X                                     (cadr sexps) (+ x_start (* 9.5 radius))  (car y_now) radius #f #f)
X
X                   (draw-Lukasiewicz-word
X                                     (cadr sexps) (+ x_start (* 13 radius))  (- (car y_now) radius) radius)
X                   (draw-n-ary-tree  (cadr sexps) (+ x_start (* 13 radius))  (car y_now) (/ radius 2) (/ radius 2) #f)
X
X
X                   (draw-qq-chords
X                                     (cadr sexps) (+ x_start (* 19 radius))  (car y_now) radius #f #f)
X
X                   (draw-cardinal-number-right
X                                     (sexp->A071156 (cadr sexps))
X                                     (+ x_start (* 21.5 radius))
X                                     (- (car y_now) radius)
X                                     radius
X                   )
X                   (draw-rr-diagram
X                                     (cadr sexps) (+ x_start (* 22 radius))  (car y_now) (/ radius 2) #f #f)
X
X                   (draw-A071158-word
X                                     (cadr sexps) (+ x_start (* 22 radius))  (- (car y_now) radius) radius)
X
X                   (draw-binary-tree (cadr sexps) (+ x_start (* 30 radius))  (car y_now) (/ radius 2) (/ radius 2) #f)
X                   (draw-polygon-triangularization
X                                     (cadr sexps) (+ x_start (* 34 radius))  (car y_now) radius #f)
X
X                   (begin
X                           (set-car! y_now (- (car y_now) y_displ))
X                           (set-car! sexps (+ (car sexps) 1)) ;; Increment out ordinal number counter.
X                           (delete! (cadr sexps) sexps)
X                           (loop)
X                   )
X               )
X            )
X            (else the-empty-pict)
X      )
X   )
X)
X
X
X(define (decr-in-list! lp x)
X  (let ((old-car (car lp)))
X     (set-car! lp (- old-car x))
X     old-car
X  )
X)
X
X;; Use as:
X;; (output-sexp-file-as-ps-file "a014486.sxp" "a014486.ps" 12 "Page ~A of http://oeis.org/A014486/a014486.pdf" *FIRST-PAGE*)
X;; (And convert the produced PS-file to PDF later).
X;;
X
X(define *FIRST-PAGE* (list
X""
X" From the left to right, after the ordinal number are shown:"
X" - the terms of A014486,"
X" - the terms of A063171, with the corresponding Catalan mountain range (*) above, and the parenthesization below each one"
X"   (* i.e. Dyck path, Stanley's interpretation (i)),"
X" - noncrossing chord arrangements (red circle, Stanley's (n), noncrossing handshakes over a circular table),"
X" - the plane general trees with n edges (Stanley's (e)), with the corresponding Lukasiewicz-word underneath (A079436),"
X" - noncrossing partitions (blue circle, Stanley's (qq)), with the terms of A071156 underneath,"
X" - noncrossing Murasaki diagrams ('genji-mon', Stanley's (rr)), with the terms of A071158 underneath,"
X" - the plane binary trees with 2n edges (Stanley's (d)), with the corresponding zigzag tree (Stanley's (c),"
X"   i.e. binary trees with n vertices) contained in their interior colored black,"
X" - triangulations of a polygon with n+2 edges (Stanley's (a))."
X" "
X" If one counts how many structures there are of each size n, one obtains Catalan numbers, A000108."
X" "
X" For further information, see entry A014486 in  On-Line Encyclopedia of Integer Sequences at http://oeis.org/A014486"
X" "
X" This version of the illustration prepared 2011 by Antti Karttunen, http://oeis.org/wiki/User:Antti_Karttunen"
X" (See under the latter page for the source code needed to recreate this document.)"
X                     )
X)
X
X
X(define (output-sexp-file-as-ps-file infile outfile radius pageheader on-the-first-page)
X   (let* ((page-top 770) ;; Note that the "US Letter" is not so tall as A4!
X          (lists (read-lists-from infile)) ;; Keep the header all the time. Because this is modified with delete!
X          (y_now (list page-top))
X          (outchannel (ps2-text-channel outfile))
X          (font-used (font "Times-Roman" 10))
X          (caption-size 10)
X          (c-font-used (font "Times-Roman" caption-size))
X         )
X     (set-car! lists 0) ;; Now we keep our ordinal number counter here!
X     (let loop ((pageno 1))
X        (cond ((not (null? (cdr lists)))
X                (format #t "Doing page ~S, (length lists)=~S, (car lists)=~S, (cadr lists)=~S~%"
X                             pageno (length lists) (car lists) (cadr lists))
X                (force-output (current-output-port))
X                (show outchannel
X                   (compose
X                      (translate (* 1 radius) (decr-in-list! y_now (if (= 1 pageno) (* 2 radius) 70))
X                         (stroke (simple-string->glyphpath font-used (format #f pageheader pageno)))
X                      )
X                      (cond ((= 1 pageno) ;; Only on the first page.
X                               (let uloop ((rows on-the-first-page))
X                                    (cond ((null? rows) (decr-in-list! y_now 32) the-empty-pict)
X                                          (else
X                                            (compose
X                                              (translate (* 1 radius) (decr-in-list! y_now (* 1 caption-size))
X                                                (stroke (simple-string->glyphpath c-font-used (car rows)))
X                                              )
X                                              (uloop (cdr rows))
X                                            )
X                                          )
X                                    )
X                               )
X                            )
X                            (else the-empty-pict)
X                      )
X                      (compose-one-instance-per-line! lists outchannel radius (* 8 radius) y_now (* 6 radius))
X                   )
X                )
X                (set-car! y_now page-top)
X                (loop (+ 1 pageno))
X              )
X        )
X     )
X     (close-channel outchannel)
X   )
X)
X
X;; (convert-sexp-file-to-multiple-ps-files "a014486_24.sxp" "kuvat/" 'n 10 0.5 0.5)
X;;
X;; Try also:
X;; (convert-sexp-file-to-multiple-ps-or-eps-files "a014486_196.sxp" "kuvat/" 'e 10 0.4 0.4 #t)
X;;
X
X(define (output-icons-for-five-interpretations)
X  (convert-sexp-file-to-multiple-ps-files "a014486_65.sxp" "kuvat/" 'n 10 0.4 0.4)
X  (convert-sexp-file-to-multiple-ps-files "a014486_65.sxp" "kuvat/" 'a 10 0.5 0.5)
X  (convert-sexp-file-to-multiple-ps-files "a014486_65.sxp" "kuvat/" 'd 10 0.5 0.5)
X  (convert-sexp-file-to-multiple-ps-files "a014486_65.sxp" "kuvat/" 'e 10 0.4 0.4)
X  (convert-sexp-file-to-multiple-ps-files "a014486_65.sxp" "kuvat/" 'i 10 0.5 0.5)
X)
X
X(define (output-icons-for-other-interpretations)
X  (convert-sexp-file-to-multiple-ps-files "a014486_196.sxp" "kuvat/" 'd 10 0.5 0.5)
X  (convert-sexp-file-to-multiple-ps-files "a014486_196.sxp" "kuvat/" 'qq 10 0.4 0.4)
X  (convert-sexp-file-to-multiple-ps-files "a014486_196.sxp" "kuvat/" 'rr 10 0.4 0.4)
X)
X
X;;
X;; Then use a C-shell-script like this:
X;;
X;; #!/bin/csh
X;; foreach file ($*)
X;; set bas=`/bin/expr $file : '\([^.]*\)'`
X;; pstopnm $file -llx 1.21 -lly 1.33 -urx 1.57 -ury 1.70 -verbose -xborder 0 -yborder 0 -xs 60 -portrait -nocrop -stdout > $bas.ppm
X;; ppmtogif -transparent white $bas.ppm > $bas.gif
X;; /bin/rm -f $bas.ppm
X;; end
X;;
X;; 
X
X(define (convert-sexp-file-to-multiple-ps-files infile outfile-prefix interpretation scale chordwidth perimwidth)
X   (convert-sexp-file-to-multiple-ps-or-eps-files infile outfile-prefix interpretation scale chordwidth perimwidth #f)
X)
X
X
X(define (convert-sexp-file-to-multiple-ps-or-eps-files infile outfile-prefix interpretation scale chordwidth perimwidth eps?)
X   (let* ((lists (read-lists-from infile)) ;; The header is the first.
X          (x 100)
X          (y 100)
X         )
X     (let loop ((n 0) (lists (cdr lists)))
X        (cond ((not (null? lists))
X                (if eps?
X                  (show-w/ps2-text-channel
X                       (format #f "~A~A~S.eps" outfile-prefix interpretation n)
X                       (compose-all-interpretations-for-a-single (car lists) scale x y (list interpretation) chordwidth perimwidth #f)
X                       (:format "EPS")
X                  )
X                  (show-w/ps2-text-channel
X                       (format #f "~A~A~S.ps" outfile-prefix interpretation n)
X                       (compose-all-interpretations-for-a-single (car lists) scale x y (list interpretation) chordwidth perimwidth #f)
X                  )
X                )
X                (loop (+ 1 n) (cdr lists))
X              )
X        )
X     )
X   )
X)
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of Catalan_Interpretations_FPS_drawing_routines.scm failed"
fi
fi
# ============= Catalan_Interpretations_conversion_functions.scm ==============
if test -f 'Catalan_Interpretations_conversion_functions.scm' && test "$first_param" != -c; then
${echo} "x - SKIPPING Catalan_Interpretations_conversion_functions.scm (file already exists)"
else
${echo} "x - extracting Catalan_Interpretations_conversion_functions.scm (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'Catalan_Interpretations_conversion_functions.scm' &&
X
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X;;                                                                          ;;
X;;         Catalan_Interpretations_conversion_functions.scm                 ;;
X;;                                                                          ;;
X;; This Scheme-code is Copyright (C) 2002-2011 by Antti Karttunen           ;;
X;; (E-mail: <my_firstname>.<my_surname>@gmail.com) and is placed under      ;;
X;;              The OEIS Contributor's License Agreement                    ;;
X;; (see: http://oeis.org/wiki/The_OEIS_Contributor%27s_License_Agreement )  ;;
X;;                                                                          ;;
X;; For an older version of this module, see URL:                            ;;
X;; http://web.archive.org/web/20050831130158/http://ndirty.cute.fi/~karttu/matikka/Nekomorphisms/gatocout.scm
X;; The first version written by Antti Karttunen April, 2002                 ;;
X;; Last modified June 17 2011.                                              ;;
X;;                                                                          ;;
X;; These functions convert s-expressions (which can be viewed either as     ;;
X;; parenthesizations or (planar & rooted) car/cdr-binary trees) to          ;;
X;; structures better suited for the output of the certain combinatorial     ;;
X;; interpretations of Catalan numbers desribed in Stanley's exercise 19.    ;;
X;;                                                                          ;;
X;; This module is independent of the actual graphics library used.          ;;
X;;                                                                          ;;
X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
X
X
X;; Transferred from gatorank.scm:
X;; (p->Lw p) converts a parenthesization 'p'to Lukasiewicz word
X;; (in car-branch first, depth-first order, discarding the last zero).
X;;
X
X;; (output_seq (map (lambda (L) (baselist->n 10 L)) (map p->Lw (map BinTree2Tree (map A014486->parenthesization (map A014486 (iota0 64)))))))
X;; --> 0,20,2020,2200,202020,202200,220020,220200,222000,... gives A071152.
X
X;; (output_seq (map (lambda (L) (baselist->n 10 L)) (map p->Lw (map A014486->parenthesization (map A014486 (iota0 64))))))
X;; --> 0,1,20,11,300,201,210,120,111,... gives A071153.
X
X;; (output_seq (sort (map (lambda (L) (baselist->n 10 L)) (map p->Lw (map A014486->parenthesization (map A014486 (iota0 64))))) <))
X;; -> 0,1,11,20,111,120,201,210,300,... gives A071154.
X
X;; Calling this for the Figure 1: (A plane tree) shown in Stanley's
X;; Hipparchus, Plutarch, Schrder and Hough, Am. Math. Monthly, Vol. 104,
X;; No. 4, p. 344, 1997. (See http://www-math.mit.edu/~rstan/papers.html)
X;; we obtain:
X;;
X;; (p->Lw '((() ()) ( (()()()()()) () (()()) ) (() () (() ()))))
X;; (3 2 0 0 3 5 0 0 0 0 0 0 2 0 0 3 0 0 2 0)
X
X(define (p->Lw p)
X  (reverse! (cdr (reverse
X    (let recurse ((p p))
X           (cond ((null? p) (list 0))
X                 (else ;; it is a list.
X                    (append! (list (length p))
X                             (apply append! (map recurse p))
X                    )
X                 )
X           )
X    )
X  )))
X)
X
X
X
X;; From the interpretation d (plane binary trees with 2n+1 vertices (i.e. n+1 endpoints))
X;; to the interpretation a (triangularizations of a convex (n + 2)-gon
X;; into n triangles by n-1 diagonals that do not intersect in their interiors).
X;;
X;; (A014486->parenthesization (A014486 1)) --> (())
X;; (bt->pt '(()))       --> ((1 . 2) (2 . 3) (1 . 3))
X;; (A014486->parenthesization (A014486 2)) --> (() ())
X;; (bt->pt '(() ()))    --> ((1 . 2) (2 . 3) (3 . 4) (2 . 4) (1 . 4))
X;; (A014486->parenthesization (A014486 3)) --> ((()))
X;; (bt->pt '((())))     --> ((1 . 2) (2 . 3) (1 . 3) (3 . 4) (1 . 4))
X;; (A014486->parenthesization (A014486 4)) --> (() () ())
X;; (bt->pt '(() () ())) --> ((1 . 2) (2 . 3) (3 . 4) (4 . 5) (3 . 5) (2 . 5) (1 . 5))
X
X;; Note that the recursion order is important
X;; (car-branch before the cdr-branch) because
X;; of the side-effects of c we are playing with.
X;; The largest n upto which we have drawn the edge segments
X;; can always be found from the cdr-part of the first
X;; pair in c, i.e. with (cdar c)
X;;
X;; The corners of the polygon are numbered clockwise
X;; from 1 to n (where n = the number of leaves (here: ()'s)
X;; in the binary tree + 1 for the root fork), so that
X;; the corner 1 is at the left end and the corner n is
X;; at the right end of the bottom ('root') edge
X;; of the polygon.
X
X(define (bt->pt bt)
X  (let ((c (list (cons 0 1))))
X     (let recurse ((bt bt) (sel +)) ;; + is playing the role of id. Not used.
X        (cond ((not (pair? bt)) ;; A leaf -> The next onto edge.
X                 (attach! (cons (cdar c) (1+ (cdar c))) c)
X              )
X              (else ;; It's a fork, so we need a diameter.
X                 (let ((left-min (recurse (car bt) min)))
X                    (attach! (cons left-min (recurse (cdr bt) max)) c)
X                 )
X              )
X        )
X        (sel (caar c) (cdar c))
X     )
X     (cdr (reverse! c))
X  )
X)
X
X;; From the interpretation n (non-crossing handshakes, i.e. nonintersecting
X;; chords joining 2n points on the circumference of a circle) to the
X;; interpretation kk (fixed-point free and non-crossing involutions of [2n]):
X
X;; (sexp->hs '())             -> ()
X;; (sexp->hs '(()))           -> ((1 . 2))
X;; (sexp->hs '(() ()))        -> ((1 . 2) (3 . 4))
X;; (sexp->hs '((())))         -> ((1 . 4) (2 . 3))
X;; (sexp->hs '(() () ()))     -> ((1 . 2) (3 . 4) (5 . 6))
X;; (sexp->hs '(() (())))      -> ((1 . 2) (3 . 6) (4 . 5))
X;; (sexp->hs '((()) ()))      -> ((1 . 4) (2 . 3) (5 . 6))
X;; (sexp->hs '((() ())))      -> ((1 . 6) (2 . 3) (4 . 5))
X;; (sexp->hs '(((()))))       -> ((1 . 6) (2 . 5) (3 . 4))
X
X;; Could be cleaner, probably:
X
X(define (sexp->hs p)
X  (let ((c (list (cons 0 0)))
X        (maxnode (list 0))
X       )
X     (let recurse ((p p))
X        (cond ((pair? p)
X                 (let ((this-trans (cons (1+ (car maxnode)) 0)))
X                    (set-car! maxnode (1+ (car maxnode)))
X                    (attach! this-trans c)
X                    (recurse (car p))
X                    (set-car! maxnode (1+ (car maxnode)))
X                    (set-cdr! this-trans (car maxnode))
X                    (recurse (cdr p))
X                 )
X              )
X        )
X     ) ; let recurse
X     (cdr (reverse! c))
X  ) ; let
X)
X
X;; From John Fiorillo's http://spectacle.berkeley.edu/~fiorillo/7genjimon.html
X
X;; Genji crests ('genji-mon') or Genji incense ('genji-k')
X;; were emblems associated with the 54 chapters of the
X;; 'Genji monogatari' ("The Tale of Genji"), written by
X;; Murasaki Shikibu in the first quarter of the eleventh century.
X
X;; See also: http://plaza27.mbn.or.jp/~921/kumiko/genjiko/genjikou.html
X;; by Kazuhiro Kunii.
X
X;; Both linked from http://www.research.att.com/projects/OEIS?Anum=A000110
X
X;; From Stanley's http://www-math.mit.edu/~rstan/ec/catsol.ps.gz page 7:
X;; (Solutions to the 27 page excerpt from his "Enumerative Combinatorics",
X;; see: http://www-math.mit.edu/~rstan/ec/catalan.ps.gz)
X
X;; (rr) Obvious bijection with (pp). (Vertical lines are in the same block
X;; if they are connected by a horizontal line.) As mentioned in the Notes
X;; to Chapter 1, Murasaki diagrams were used in The Tale of Genji
X;; to represent the 52 partitions of a five-element set.
X;; The noncrossing Murasaki diagrams correspond exactly to the
X;; noncrossing partitions. The statement that noncrossing Murasaki diagrams
X;; are enumerated by Catalan numbers seems first to have been observed
X;; by H. W. Gould, who pointed it out to M. Gardner, leading to its
X;; mention in [27]. Murasaki diagrams were not actually used by
X;; Lady Murasaki herself. It wasn't until the Wasan period of old
X;; Japanese mathematics, from the late 1600s well into the 1700s,
X;; that the Wasanists started attaching the Murasaki diagrams
X;; (which were actually incense diagrams) to illustrated editions
X;; of The Tale of Genji.
X
X;; Works like this:
X;; Old order was like this:
X;; (sexp->pp-qq-rr-cycles '())         --> ()
X;; (sexp->pp-qq-rr-cycles '(()))       --> ((1))
X;; (sexp->pp-qq-rr-cycles '(()()))     --> ((1 2))
X;; (sexp->pp-qq-rr-cycles '((())))     --> ((1) (2))
X;; (sexp->pp-qq-rr-cycles '(() () ())) --> ((1 2 3))
X;; (sexp->pp-qq-rr-cycles '(() (())))  --> ((1 2) (3))
X;; (sexp->pp-qq-rr-cycles '((()) ()))  --> ((1 3) (2))
X;; (sexp->pp-qq-rr-cycles '((()())))   --> ((1) (2 3))
X;; (sexp->pp-qq-rr-cycles '(((()))))   --> ((1) (2) (3))
X
X(define (sexp->pp-qq-rr-cycles-old-order s)
X  (let ((res (list (list (list))))
X        (pos 0)
X       )
X    (let recurse ((s s) (depth 0) (newstick? #t))
X          (cond ((pair? s)
X                   (cond (newstick?
X                            (set! pos (1+ pos))
X                            (attach! (list depth pos) res)
X                         )
X                         ((assoc depth res) ;; Always found!
X                            => (lambda (c) (set! pos (1+ pos)) (attach! pos (cdr c)))
X                         )
X                         (else (error "sexp->pp-qq-rr-cycles: no list beginning with " depth
X                                      " found from " res " pos=" pos)
X                         )
X                   )
X                   (cond ((pair? (car s))
X                            (recurse (car s) (1+ depth) #t)
X                         )
X                   )
X                   (recurse (cdr s) depth #f)
X                )
X          )
X    )
X    (map reverse! (map cdr (cdr (reverse! res))))
X  )
X)
X
X
X;;
X;; (sexp->pp-qq-rr-cycles '(()()))     --> ((1 2))
X;; (sexp->pp-qq-rr-cycles '((())))     --> ((2) (1))
X;; (sexp->pp-qq-rr-cycles '(()()()))   --> ((1 2 3))
X;; (sexp->pp-qq-rr-cycles '(()(())))   --> ((1 3) (2))
X;; (sexp->pp-qq-rr-cycles '((())()))   --> ((2 3) (1))
X;; (sexp->pp-qq-rr-cycles '((()())))   --> ((3) (1 2))
X;; (sexp->pp-qq-rr-cycles '(((()))))   --> ((3) (2) (1))
X;; And:
X;; (sexp->pp-qq-rr-cycles '((() (() (()()()) (())))))   --> ((10) (1 9) (2 6 8) (7) (3 4 5))
X;; (sexp->pp-qq-rr-cycles '((() (() (()(())) (())))))   --> ((10) (1 9) (2 6 8) (7) (3 5) (4))
X;; (sexp->pp-qq-rr-cycles '((() (() ((())()) (())))))   --> ((10) (1 9) (2 6 8) (7) (4 5) (3))
X;;
X
X;; Could be more elegant & symmetric, I think.
X;; Map according to the descending (right-side) edge, so thus call DeepReverse first:
X
X;; Borrowed from gatomorf.scm:
X(define (*A057164 s) ;; Was: DeepRev
X   (cond ((not (pair? s)) s)
X         ((null? (cdr s)) (cons (*A057164 (car s)) (list)))
X         (else (append (*A057164 (cdr s))
X                       (*A057164 (cons (car s) (list))))
X         )
X   )
X)
X
X(define (sexp->pp-qq-rr-cycles s)
X  (let ((res (list (list (list))))
X        (pos (1+ (count-pars s)))
X       )
X    (let recurse ((s (*A057164 s)) (depth 0) (newstick? #t))
X          (cond ((pair? s)
X                   (cond (newstick?
X                            (set! pos (-1+ pos))
X                            (attach! (list depth pos) res)
X                         )
X                         ((assoc depth res) ;; Always found!
X                            => (lambda (c) (set! pos (-1+ pos)) (attach! pos (cdr c)))
X                         )
X                         (else (error "sexp->pp-qq-rr-cycles: no list beginning with " depth
X                                      " found from " res " pos=" pos)
X                         )
X                   )
X                   (cond ((pair? (car s))
X                            (recurse (car s) (1+ depth) #t)
X                         )
X                   )
X                   (recurse (cdr s) depth #f)
X                )
X          )
X    )
X    (map cdr (cdr (reverse! res)))
X  )
X)
X
X
X(define (cycle->pairs cycle)
X   (let loop ((res (list (last-pair cycle))) (cycle cycle))
X       (cond ((null? cycle) (cdr (reverse! res)))
X             (else (loop (cons (cons (car cycle) (caar res)) res) (cdr cycle)))
X       )
X   )
X)
X
X;; Map according to the descending (right-side) edge, so thus call DeepReverse first:
X(define (sexp->pp-qq-rr s) (append-map! cycle->pairs (sexp->pp-qq-rr-cycles s)))
X
X;; Find the first "hole" in the ascending list of integers, #f is there is no hole:
X;; (next-hole '(3 4 5)) -> #f
X;; (next-hole '(3 4 7)) -> 5
X;;
X
X(define (next-hole lista)
X   (cond ((null? lista) #f)
X         ((null? (cdr lista)) #f)
X         ((> (cadr lista) (1+ (car lista))) (1+ (car lista)))
X         (else (next-hole (cdr lista)))
X   )
X)
X
X
X;; (find-all-holes '(1 3 5 10 12)) --> '(2 4 6 7 8 9 11)
X
X(define (find-all-holes lista)
X (if (pair? lista)
X     (let loop ((res (list)) (lista (cdr lista)) (a (1+ (car lista))))
X        (cond ((null? lista) (reverse! res))
X              ((> (car lista) a) (loop (cons a res) lista (1+ a)))
X              (else (loop res (cdr lista) (1+ a))) ;; Otherwise a = (car lista)
X        )
X     )
X     lista
X )
X)
X
X;; It's mandatory that each partition in partitions is sorted in ascending order,
X;; from the least to the largest! partitions list itself don't need to be sorted.
X
X;; (add-depths-to-rr-parts! (sexp->pp-qq-rr-cycles '((() (() (()()()) (())))))) --> '((0 1 9) (1 2 6 8) (2 3 4 5) (2 7) (0 10))
X;; (add-depths-to-rr-parts! (sexp->pp-qq-rr-cycles '((() (() (()(())) (())))))) --> '((0 1 9) (1 2 6 8) (2 3 5) (3 4) (2 7) (0 10))
X;; (add-depths-to-rr-parts! (sexp->pp-qq-rr-cycles '((() (() ((())()) (())))))) --> '((0 1 9) (1 2 6 8) (2 3) (2 4 5) (2 7) (0 10))
X
X(define (add-depths-to-rr-parts! partitions)
X  (let ((res (list (list))))
X    (let aihvus ((pos 1) (depth 0))
X          (cond ((assoc pos partitions)
X                  => (lambda (c)
X                       (attach! (attach! depth c) res)           ;; Transfer depth-prefixed partition c to the front of res
X                       (set! partitions (delete! c partitions))  ;; and delete from partitions.
X                       (let ((positions-inside (find-all-holes c)))
X                          (for-each (lambda (pos)
X                                      (aihvus pos (1+ depth))
X                                    )
X                                    positions-inside
X                          )
X                          (aihvus (1+ (car (last-pair c))) depth)
X                       )
X                     )
X                )
X          )
X    )
X    (cdr (reverse! res))
X  )
X)
X
X;; Borrowed from gatoaltr.scm:
X
X
X(define (p->code1 p)
X  (let ((cs (list (list))))
X     (let recurse ((p p) (level 0))
X        (cond
X          ((pair? p)
X              (cond ((pair? (car p))
X                       (attach! (1+ level) cs)
X                       (recurse (car p) (1+ level))
X                    )
X              )
X              (cond ((pair? (cdr p))
X                       (attach! level cs)
X                       (recurse (cdr p) level)
X                    )
X              )
X          )
X        )
X     ) ;; let recurse
X     (cdr (reverse! cs))
X  )
X)
X
X;; I.e. add one to each, and concatenate 1 to the front: (I have forgotten why...)
X(define (p->zerofree-code1 p)
X   (p->code1 (cons p '()))
X)
X
X(define (p->factbase p)
X   (factbaseR->n (p->zerofree-code1 p))
X)
X
X(define (sexp->A071157 s) (reverse! (p->zerofree-code1 s)))
X
X(define (sexp->A071155 s) (p->factbase s))
X
X(define (sexp->A071158 s) (reverse! (p->zerofree-code1 (*A057164 s))))
X(define (sexp->A071156 s) (sexp->A071155 (*A057164 s)))
X
X;; 
X;; (sexp->A071158 '(()()())) --> '(1 1 1)  (sexp->A071156 '(()()())) --> 9
X;; (sexp->A071158 '(()(()))) --> '(1 2 1)  (sexp->A071156 '(()(()))) --> 11
X;; (sexp->A071158 '((())())) --> '(2 1 1)  (sexp->A071156 '((())())) --> 15
X;; (sexp->A071158 '((()()))) --> '(2 2 1)  (sexp->A071156 '((()()))) --> 17
X;; (sexp->A071158 '(((())))) --> '(3 2 1)  (sexp->A071156 '(((())))) --> 23
X;;
X
X;; Borrowed and modified from http://www.iki.fi/~kartturi/Schemuli/intfuns1.scm
X(define (factbaseR->n rex) ;; Convert the reversed factorial expansion list to an integer.
X   (let loop ((rex rex) (n 0) (i 1) (fn 1))
X      (cond ((null? rex) n)
X            (else (loop (cdr rex) (+ n (* fn (car rex))) (+ 1 i) (* fn (+ 1 i))))
X      )
X   )
X)
X
X
X
X;; Does either of these implement (accidentally) any of the
X;; algorithms mentioned in "Drawing trees nicely with TeX",
X;; by A. Brggemann-Klein and D. Wood, available at:
X;; http://cajun.cs.nott.ac.uk/compsci/epo/papers/volume2/issue2/epabk022.pdf ??
X;;
X;; See also: Jeremy Gibbons, Deriving Tidy Drawings of Trees.
X;; Journal of Functional Programming, 6(3) p535-562, 1996.
X;; http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/drawing.ps.gz
X;;
X
X;; For the "optimized" output of the binary trees we first construct
X;; a breadth-first-wise "spread-tree" (cf. spreadsheet) of the
X;; car/cdr-tree to be output (with the function construct-coordinate-tree),
X;; and then "instantiate" its nodes with clash-free X-coordinates
X;; using the function fill-cordtree-x-coordinates!
X
X;;
X;; Construct a list structure like:
X;; (construct-coordinate-tree '(a . (b . c)))
X;; --> (((0 . 0)) (((0 . 0)) ((0 . 0))) ((((0 . 0))) (((0 . 0)))))
X;;
X;; (construct-coordinate-tree '((a . b) . c))
X;; --> (((0 . 0)) (((0 . 0)) ((0 . 0))) ((((0 . 0)) ((0 . 0))) (((0 . 0)) ((0 . 0)))))
X;;
X
X(define (construct-coordinate-tree bt)
X  (let ((cs (list (list (cons 0 0))))) ;; The root at x-position 0.
X   ((lambda (recfun)
X      (cond ((pair? bt)
X        (recfun (cdr bt) 1)
X        (recfun (car bt) 1)
X      ))
X      cs
X    )
X     (letrec ((recurse (lambda (bt depth)
X                (let ((this-level (nthcdr depth cs))
X                      (prev-level (list-ref cs (- depth 1)))
X                     )
X
X                 (if (pair? this-level) ;; Not the first of this level.
X                     (set-car! this-level (cons prev-level (car this-level)))
X                     (append! cs (list (list prev-level)))
X                 )
X                 (cond ((pair? bt)
X                          (recurse (cdr bt) (1+ depth))
X                          (recurse (car bt) (1+ depth))
X                       )
X                 ) ; cond
X                ) ; let
X             )))
X           recurse
X     ) ; letrec
X   ) ; lambda
X  ) ; let
X)
X
X
X(define (repl-parent-pointers-with-coord-pairs! lista x-displ)
X   (cond ((pair? lista)
X            (set-car! lista (cons (+ (caaar lista) x-displ) (caaar lista)))
X            (repl-parent-pointers-with-coord-pairs! (cdr lista) (- x-displ))
X         )
X   )
X)
X
X(define (add-displ-to-each-child-x! lista x-displ)
X   (cond ((pair? lista)
X            (set-car! (car lista) (+ (caar lista) x-displ))
X            (add-displ-to-each-child-x! (cdr lista) (- x-displ))
X         )
X   )
X)
X
X(define (clash-free? level)
X   (or (null? level)
X       (null? (cdr level))
X       (apply < (map car level))
X   )
X)
X
X
X;; (fill-cordtree-x-coordinates! (construct-coordinate-tree '()) 1)
X;; --> (((0 . 0)))
X;; (fill-cordtree-x-coordinates! (construct-coordinate-tree '(a . b)) 1)
X;; --> (((0 . 0)) ((-1 . 0) (1 . 0)))
X;; (fill-cordtree-x-coordinates! (construct-coordinate-tree '(a . (b . c))) 1)
X;; --> (((0 . 0)) ((-1 . 0) (1 . 0)) ((0 . 1) (2 . 1)))
X;; (fill-cordtree-x-coordinates! (construct-coordinate-tree '((a . b) . c)) 1)
X;; --> (((0 . 0)) ((-1 . 0) (1 . 0)) ((-2 . -1) (0 . -1)))
X;; (fill-cordtree-x-coordinates! (construct-coordinate-tree '((a . b) . (c . d))) 1)
X;; --> (((0 . 0)) ((-1 . 0) (1 . 0)) ((-3/2 . -1) (-1/2 . -1) (1/2 . 1) (3/2 . 1)))
X;;  (fill-cordtree-x-coordinates! (construct-coordinate-tree '((a . (b . c)) . ((d . e) . f))) 1)
X;; --> (((0 . 0)) ((-1 . 0) (1 . 0)) ((-3/2 . -1) (-1/2 . -1) (1/2 . 1) (3/2 . 1)) ((-3/4 . -1/2) (-1/4 . -1/2) (1/4 . 1/2) (3/4 . 1/2)))
X;; 
X
X
X;; Call as (fill-cordtree-x-coordinates! (construct-coordinate-tree bt) x-displ #f)
X(define (fill-cordtree-x-coordinates! ct x-displ never-contract?) ;; New argument added 12. Feb 2003.
X  (cond ((pair? ct)
X           (cond ((not (number? (caaar ct))) ;; Still pointers to parents at this level.
X                   (repl-parent-pointers-with-coord-pairs! (car ct) (- x-displ))
X                   (fill-cordtree-x-coordinates! ct x-displ never-contract?) ;; And check again.
X                 )
X                 ((or never-contract?
X                      (clash-free? (car ct)) ;; If this level is clash-free, then continue
X                  )
X                   (fill-cordtree-x-coordinates! (cdr ct) x-displ never-contract?)
X                 )
X                 (else ;; We have to contract the branches at this level.
X                   (add-displ-to-each-child-x! (car ct) (/ x-displ 2))
X                   (fill-cordtree-x-coordinates! ct (/ x-displ 2) never-contract?) ;; And try again.
X                 )
X           )
X        )
X  )
X  ct
X)
X
X
X
X;; (p->tree-x-coordinates '())       --> (1)
X;; (p->tree-x-coordinates '(()))     --> (1 (1))
X;; (p->tree-x-coordinates '((())))   --> (1 (1 (1)))
X;; (p->tree-x-coordinates '(()()))   --> (3/2 (1) (2))
X;; (p->tree-x-coordinates '(()()())) --> (2 (1) (2) (3))
X;; (p->tree-x-coordinates '((())())) --> (3/2 (1 (1)) (2))
X;; (p->tree-x-coordinates '(()(()))) --> (3/2 (1) (2 (2)))
X;; (p->tree-x-coordinates '((()()))) --> (3/2 (3/2 (1) (2)))
X;; (p->tree-x-coordinates '(((())))) --> (1 (1 (1 (1))))
X
X
X(define (incr x) (set-car! x (+ (car x) 1)) (car x))
X
X
X(define (average-x-of branches)
X   (/ (apply + (map car branches)) (length branches))
X)
X
X(define (p->tree-x-coordinates p)
X  (let ((max_x (list 0)))
X    (let recurse ((p p))
X       (cond ((not (pair? p)) (list (incr max_x)))
X             (else
X               (let ((branches (map recurse p)))
X                  (cons (average-x-of branches) branches)
X               )
X             )
X       )
X    )
X  )
X)
X
X
X
X;; (normalize-root-to-zero-and-scale! (p->tree-x-coordinates '(()((())()))) 12)
X;; --> (0 (-9) (9 (3 (3)) (15)))
X
X(define (normalize-root-to-zero-and-scale! tx x-scale)
X   (let ((off (car tx)))
X      (let recurse ((tx tx))
X         (cond ((pair? tx)
X                    (if (number? (car tx))
X                        (set-car! tx (* (- (car tx) off) x-scale))
X                        (recurse (car tx))
X                    )
X                    (recurse (cdr tx))
X               )
X         )
X      )
X      tx
X   )
X)
X
X
X
X
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of Catalan_Interpretations_conversion_functions.scm failed"
fi
fi
# ============= a014486.sxp ==============
if test -f 'a014486.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a014486.sxp (file already exists)"
else
${echo} "x - extracting a014486.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a014486.sxp' &&
X("A014486 upto the size 7")
X()
X(())
X(() ())
X((()))
X(() () ())
X(() (()))
X((()) ())
X((() ()))
X(((())))
X(() () () ())
X(() () (()))
X(() (()) ())
X(() (() ()))
X(() ((())))
X((()) () ())
X((()) (()))
X((() ()) ())
X((() () ()))
X((() (())))
X(((())) ())
X(((()) ()))
X(((() ())))
X((((()))))
X(() () () () ())
X(() () () (()))
X(() () (()) ())
X(() () (() ()))
X(() () ((())))
X(() (()) () ())
X(() (()) (()))
X(() (() ()) ())
X(() (() () ()))
X(() (() (())))
X(() ((())) ())
X(() ((()) ()))
X(() ((() ())))
X(() (((()))))
X((()) () () ())
X((()) () (()))
X((()) (()) ())
X((()) (() ()))
X((()) ((())))
X((() ()) () ())
X((() ()) (()))
X((() () ()) ())
X((() () () ()))
X((() () (())))
X((() (())) ())
X((() (()) ()))
X((() (() ())))
X((() ((()))))
X(((())) () ())
X(((())) (()))
X(((()) ()) ())
X(((()) () ()))
X(((()) (())))
X(((() ())) ())
X(((() ()) ()))
X(((() () ())))
X(((() (()))))
X((((()))) ())
X((((())) ()))
X((((()) ())))
X((((() ()))))
X(((((())))))
X(() () () () () ())
X(() () () () (()))
X(() () () (()) ())
X(() () () (() ()))
X(() () () ((())))
X(() () (()) () ())
X(() () (()) (()))
X(() () (() ()) ())
X(() () (() () ()))
X(() () (() (())))
X(() () ((())) ())
X(() () ((()) ()))
X(() () ((() ())))
X(() () (((()))))
X(() (()) () () ())
X(() (()) () (()))
X(() (()) (()) ())
X(() (()) (() ()))
X(() (()) ((())))
X(() (() ()) () ())
X(() (() ()) (()))
X(() (() () ()) ())
X(() (() () () ()))
X(() (() () (())))
X(() (() (())) ())
X(() (() (()) ()))
X(() (() (() ())))
X(() (() ((()))))
X(() ((())) () ())
X(() ((())) (()))
X(() ((()) ()) ())
X(() ((()) () ()))
X(() ((()) (())))
X(() ((() ())) ())
X(() ((() ()) ()))
X(() ((() () ())))
X(() ((() (()))))
X(() (((()))) ())
X(() (((())) ()))
X(() (((()) ())))
X(() (((() ()))))
X(() ((((())))))
X((()) () () () ())
X((()) () () (()))
X((()) () (()) ())
X((()) () (() ()))
X((()) () ((())))
X((()) (()) () ())
X((()) (()) (()))
X((()) (() ()) ())
X((()) (() () ()))
X((()) (() (())))
X((()) ((())) ())
X((()) ((()) ()))
X((()) ((() ())))
X((()) (((()))))
X((() ()) () () ())
X((() ()) () (()))
X((() ()) (()) ())
X((() ()) (() ()))
X((() ()) ((())))
X((() () ()) () ())
X((() () ()) (()))
X((() () () ()) ())
X((() () () () ()))
X((() () () (())))
X((() () (())) ())
X((() () (()) ()))
X((() () (() ())))
X((() () ((()))))
X((() (())) () ())
X((() (())) (()))
X((() (()) ()) ())
X((() (()) () ()))
X((() (()) (())))
X((() (() ())) ())
X((() (() ()) ()))
X((() (() () ())))
X((() (() (()))))
X((() ((()))) ())
X((() ((())) ()))
X((() ((()) ())))
X((() ((() ()))))
X((() (((())))))
X(((())) () () ())
X(((())) () (()))
X(((())) (()) ())
X(((())) (() ()))
X(((())) ((())))
X(((()) ()) () ())
X(((()) ()) (()))
X(((()) () ()) ())
X(((()) () () ()))
X(((()) () (())))
X(((()) (())) ())
X(((()) (()) ()))
X(((()) (() ())))
X(((()) ((()))))
X(((() ())) () ())
X(((() ())) (()))
X(((() ()) ()) ())
X(((() ()) () ()))
X(((() ()) (())))
X(((() () ())) ())
X(((() () ()) ()))
X(((() () () ())))
X(((() () (()))))
X(((() (()))) ())
X(((() (())) ()))
X(((() (()) ())))
X(((() (() ()))))
X(((() ((())))))
X((((()))) () ())
X((((()))) (()))
X((((())) ()) ())
X((((())) () ()))
X((((())) (())))
X((((()) ())) ())
X((((()) ()) ()))
X((((()) () ())))
X((((()) (()))))
X((((() ()))) ())
X((((() ())) ()))
X((((() ()) ())))
X((((() () ()))))
X((((() (())))))
X(((((())))) ())
X(((((()))) ()))
X(((((())) ())))
X(((((()) ()))))
X(((((() ())))))
X((((((()))))))
X(() () () () () () ())
X(() () () () () (()))
X(() () () () (()) ())
X(() () () () (() ()))
X(() () () () ((())))
X(() () () (()) () ())
X(() () () (()) (()))
X(() () () (() ()) ())
X(() () () (() () ()))
X(() () () (() (())))
X(() () () ((())) ())
X(() () () ((()) ()))
X(() () () ((() ())))
X(() () () (((()))))
X(() () (()) () () ())
X(() () (()) () (()))
X(() () (()) (()) ())
X(() () (()) (() ()))
X(() () (()) ((())))
X(() () (() ()) () ())
X(() () (() ()) (()))
X(() () (() () ()) ())
X(() () (() () () ()))
X(() () (() () (())))
X(() () (() (())) ())
X(() () (() (()) ()))
X(() () (() (() ())))
X(() () (() ((()))))
X(() () ((())) () ())
X(() () ((())) (()))
X(() () ((()) ()) ())
X(() () ((()) () ()))
X(() () ((()) (())))
X(() () ((() ())) ())
X(() () ((() ()) ()))
X(() () ((() () ())))
X(() () ((() (()))))
X(() () (((()))) ())
X(() () (((())) ()))
X(() () (((()) ())))
X(() () (((() ()))))
X(() () ((((())))))
X(() (()) () () () ())
X(() (()) () () (()))
X(() (()) () (()) ())
X(() (()) () (() ()))
X(() (()) () ((())))
X(() (()) (()) () ())
X(() (()) (()) (()))
X(() (()) (() ()) ())
X(() (()) (() () ()))
X(() (()) (() (())))
X(() (()) ((())) ())
X(() (()) ((()) ()))
X(() (()) ((() ())))
X(() (()) (((()))))
X(() (() ()) () () ())
X(() (() ()) () (()))
X(() (() ()) (()) ())
X(() (() ()) (() ()))
X(() (() ()) ((())))
X(() (() () ()) () ())
X(() (() () ()) (()))
X(() (() () () ()) ())
X(() (() () () () ()))
X(() (() () () (())))
X(() (() () (())) ())
X(() (() () (()) ()))
X(() (() () (() ())))
X(() (() () ((()))))
X(() (() (())) () ())
X(() (() (())) (()))
X(() (() (()) ()) ())
X(() (() (()) () ()))
X(() (() (()) (())))
X(() (() (() ())) ())
X(() (() (() ()) ()))
X(() (() (() () ())))
X(() (() (() (()))))
X(() (() ((()))) ())
X(() (() ((())) ()))
X(() (() ((()) ())))
X(() (() ((() ()))))
X(() (() (((())))))
X(() ((())) () () ())
X(() ((())) () (()))
X(() ((())) (()) ())
X(() ((())) (() ()))
X(() ((())) ((())))
X(() ((()) ()) () ())
X(() ((()) ()) (()))
X(() ((()) () ()) ())
X(() ((()) () () ()))
X(() ((()) () (())))
X(() ((()) (())) ())
X(() ((()) (()) ()))
X(() ((()) (() ())))
X(() ((()) ((()))))
X(() ((() ())) () ())
X(() ((() ())) (()))
X(() ((() ()) ()) ())
X(() ((() ()) () ()))
X(() ((() ()) (())))
X(() ((() () ())) ())
X(() ((() () ()) ()))
X(() ((() () () ())))
X(() ((() () (()))))
X(() ((() (()))) ())
X(() ((() (())) ()))
X(() ((() (()) ())))
X(() ((() (() ()))))
X(() ((() ((())))))
X(() (((()))) () ())
X(() (((()))) (()))
X(() (((())) ()) ())
X(() (((())) () ()))
X(() (((())) (())))
X(() (((()) ())) ())
X(() (((()) ()) ()))
X(() (((()) () ())))
X(() (((()) (()))))
X(() (((() ()))) ())
X(() (((() ())) ()))
X(() (((() ()) ())))
X(() (((() () ()))))
X(() (((() (())))))
X(() ((((())))) ())
X(() ((((()))) ()))
X(() ((((())) ())))
X(() ((((()) ()))))
X(() ((((() ())))))
X(() (((((()))))))
X((()) () () () () ())
X((()) () () () (()))
X((()) () () (()) ())
X((()) () () (() ()))
X((()) () () ((())))
X((()) () (()) () ())
X((()) () (()) (()))
X((()) () (() ()) ())
X((()) () (() () ()))
X((()) () (() (())))
X((()) () ((())) ())
X((()) () ((()) ()))
X((()) () ((() ())))
X((()) () (((()))))
X((()) (()) () () ())
X((()) (()) () (()))
X((()) (()) (()) ())
X((()) (()) (() ()))
X((()) (()) ((())))
X((()) (() ()) () ())
X((()) (() ()) (()))
X((()) (() () ()) ())
X((()) (() () () ()))
X((()) (() () (())))
X((()) (() (())) ())
X((()) (() (()) ()))
X((()) (() (() ())))
X((()) (() ((()))))
X((()) ((())) () ())
X((()) ((())) (()))
X((()) ((()) ()) ())
X((()) ((()) () ()))
X((()) ((()) (())))
X((()) ((() ())) ())
X((()) ((() ()) ()))
X((()) ((() () ())))
X((()) ((() (()))))
X((()) (((()))) ())
X((()) (((())) ()))
X((()) (((()) ())))
X((()) (((() ()))))
X((()) ((((())))))
X((() ()) () () () ())
X((() ()) () () (()))
X((() ()) () (()) ())
X((() ()) () (() ()))
X((() ()) () ((())))
X((() ()) (()) () ())
X((() ()) (()) (()))
X((() ()) (() ()) ())
X((() ()) (() () ()))
X((() ()) (() (())))
X((() ()) ((())) ())
X((() ()) ((()) ()))
X((() ()) ((() ())))
X((() ()) (((()))))
X((() () ()) () () ())
X((() () ()) () (()))
X((() () ()) (()) ())
X((() () ()) (() ()))
X((() () ()) ((())))
X((() () () ()) () ())
X((() () () ()) (()))
X((() () () () ()) ())
X((() () () () () ()))
X((() () () () (())))
X((() () () (())) ())
X((() () () (()) ()))
X((() () () (() ())))
X((() () () ((()))))
X((() () (())) () ())
X((() () (())) (()))
X((() () (()) ()) ())
X((() () (()) () ()))
X((() () (()) (())))
X((() () (() ())) ())
X((() () (() ()) ()))
X((() () (() () ())))
X((() () (() (()))))
X((() () ((()))) ())
X((() () ((())) ()))
X((() () ((()) ())))
X((() () ((() ()))))
X((() () (((())))))
X((() (())) () () ())
X((() (())) () (()))
X((() (())) (()) ())
X((() (())) (() ()))
X((() (())) ((())))
X((() (()) ()) () ())
X((() (()) ()) (()))
X((() (()) () ()) ())
X((() (()) () () ()))
X((() (()) () (())))
X((() (()) (())) ())
X((() (()) (()) ()))
X((() (()) (() ())))
X((() (()) ((()))))
X((() (() ())) () ())
X((() (() ())) (()))
X((() (() ()) ()) ())
X((() (() ()) () ()))
X((() (() ()) (())))
X((() (() () ())) ())
X((() (() () ()) ()))
X((() (() () () ())))
X((() (() () (()))))
X((() (() (()))) ())
X((() (() (())) ()))
X((() (() (()) ())))
X((() (() (() ()))))
X((() (() ((())))))
X((() ((()))) () ())
X((() ((()))) (()))
X((() ((())) ()) ())
X((() ((())) () ()))
X((() ((())) (())))
X((() ((()) ())) ())
X((() ((()) ()) ()))
X((() ((()) () ())))
X((() ((()) (()))))
X((() ((() ()))) ())
X((() ((() ())) ()))
X((() ((() ()) ())))
X((() ((() () ()))))
X((() ((() (())))))
X((() (((())))) ())
X((() (((()))) ()))
X((() (((())) ())))
X((() (((()) ()))))
X((() (((() ())))))
X((() ((((()))))))
X(((())) () () () ())
X(((())) () () (()))
X(((())) () (()) ())
X(((())) () (() ()))
X(((())) () ((())))
X(((())) (()) () ())
X(((())) (()) (()))
X(((())) (() ()) ())
X(((())) (() () ()))
X(((())) (() (())))
X(((())) ((())) ())
X(((())) ((()) ()))
X(((())) ((() ())))
X(((())) (((()))))
X(((()) ()) () () ())
X(((()) ()) () (()))
X(((()) ()) (()) ())
X(((()) ()) (() ()))
X(((()) ()) ((())))
X(((()) () ()) () ())
X(((()) () ()) (()))
X(((()) () () ()) ())
X(((()) () () () ()))
X(((()) () () (())))
X(((()) () (())) ())
X(((()) () (()) ()))
X(((()) () (() ())))
X(((()) () ((()))))
X(((()) (())) () ())
X(((()) (())) (()))
X(((()) (()) ()) ())
X(((()) (()) () ()))
X(((()) (()) (())))
X(((()) (() ())) ())
X(((()) (() ()) ()))
X(((()) (() () ())))
X(((()) (() (()))))
X(((()) ((()))) ())
X(((()) ((())) ()))
X(((()) ((()) ())))
X(((()) ((() ()))))
X(((()) (((())))))
X(((() ())) () () ())
X(((() ())) () (()))
X(((() ())) (()) ())
X(((() ())) (() ()))
X(((() ())) ((())))
X(((() ()) ()) () ())
X(((() ()) ()) (()))
X(((() ()) () ()) ())
X(((() ()) () () ()))
X(((() ()) () (())))
X(((() ()) (())) ())
X(((() ()) (()) ()))
X(((() ()) (() ())))
X(((() ()) ((()))))
X(((() () ())) () ())
X(((() () ())) (()))
X(((() () ()) ()) ())
X(((() () ()) () ()))
X(((() () ()) (())))
X(((() () () ())) ())
X(((() () () ()) ()))
X(((() () () () ())))
X(((() () () (()))))
X(((() () (()))) ())
X(((() () (())) ()))
X(((() () (()) ())))
X(((() () (() ()))))
X(((() () ((())))))
X(((() (()))) () ())
X(((() (()))) (()))
X(((() (())) ()) ())
X(((() (())) () ()))
X(((() (())) (())))
X(((() (()) ())) ())
X(((() (()) ()) ()))
X(((() (()) () ())))
X(((() (()) (()))))
X(((() (() ()))) ())
X(((() (() ())) ()))
X(((() (() ()) ())))
X(((() (() () ()))))
X(((() (() (())))))
X(((() ((())))) ())
X(((() ((()))) ()))
X(((() ((())) ())))
X(((() ((()) ()))))
X(((() ((() ())))))
X(((() (((()))))))
X((((()))) () () ())
X((((()))) () (()))
X((((()))) (()) ())
X((((()))) (() ()))
X((((()))) ((())))
X((((())) ()) () ())
X((((())) ()) (()))
X((((())) () ()) ())
X((((())) () () ()))
X((((())) () (())))
X((((())) (())) ())
X((((())) (()) ()))
X((((())) (() ())))
X((((())) ((()))))
X((((()) ())) () ())
X((((()) ())) (()))
X((((()) ()) ()) ())
X((((()) ()) () ()))
X((((()) ()) (())))
X((((()) () ())) ())
X((((()) () ()) ()))
X((((()) () () ())))
X((((()) () (()))))
X((((()) (()))) ())
X((((()) (())) ()))
X((((()) (()) ())))
X((((()) (() ()))))
X((((()) ((())))))
X((((() ()))) () ())
X((((() ()))) (()))
X((((() ())) ()) ())
X((((() ())) () ()))
X((((() ())) (())))
X((((() ()) ())) ())
X((((() ()) ()) ()))
X((((() ()) () ())))
X((((() ()) (()))))
X((((() () ()))) ())
X((((() () ())) ()))
X((((() () ()) ())))
X((((() () () ()))))
X((((() () (())))))
X((((() (())))) ())
X((((() (()))) ()))
X((((() (())) ())))
X((((() (()) ()))))
X((((() (() ())))))
X((((() ((()))))))
X(((((())))) () ())
X(((((())))) (()))
X(((((()))) ()) ())
X(((((()))) () ()))
X(((((()))) (())))
X(((((())) ())) ())
X(((((())) ()) ()))
X(((((())) () ())))
X(((((())) (()))))
X(((((()) ()))) ())
X(((((()) ())) ()))
X(((((()) ()) ())))
X(((((()) () ()))))
X(((((()) (())))))
X(((((() ())))) ())
X(((((() ()))) ()))
X(((((() ())) ())))
X(((((() ()) ()))))
X(((((() () ())))))
X(((((() (()))))))
X((((((()))))) ())
X((((((())))) ()))
X((((((()))) ())))
X((((((())) ()))))
X((((((()) ())))))
X((((((() ()))))))
X(((((((())))))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a014486.sxp failed"
fi
fi
# ============= a057161.sxp ==============
if test -f 'a057161.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a057161.sxp (file already exists)"
else
${echo} "x - extracting a057161.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a057161.sxp' &&
X("RotateTriangularization" 5)
X((()))
X(((())))
X(((() ()) ((()))))
X(((() () ()) ((() ())) ((()) ()) (() (())) (((())))))
X(((() () () ()) ((() () ())) ((() ()) ()) ((()) (())) (() ((()))) ((((()))))) ((() () (())) ((() (()))) (((())) ())) ((() (()) ()) (((()) ()))) ((() (() ())) (((() ()))) ((()) () ())))
X(((() () () () ()) ((() () () ())) ((() () ()) ()) ((() ()) (())) ((()) ((()))) (() (((())))) (((((())))))) ((() () () (())) ((() () (()))) ((() (())) ()) (((())) (())) (() () ((()))) ((() ((())))) ((((()))) ())) ((() () (()) ()) ((() (()) ())) (((()) ()) ()) (() (()) (())) (((()) (()))) (() ((())) ()) ((((())) ()))) ((() () (() ())) ((() (() ()))) (((() ())) ()) ((()) () (())) (() (() (()))) (((() (())))) (((())) () ())) ((() (()) () ()) (((()) () ())) (() (() ()) ()) (((() ()) ())) ((()) (()) ()) (() ((()) ())) ((((()) ())))) ((() (() () ())) (((() () ()))) ((() ()) () ()) ((()) (() ())) (() ((() ()))) ((((() ())))) ((()) () () ())))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a057161.sxp failed"
fi
fi
# ============= a057501.sxp ==============
if test -f 'a057501.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a057501.sxp (file already exists)"
else
${echo} "x - extracting a057501.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a057501.sxp' &&
X("RotateHandshakes" 5)
X((()))
X(((())))
X(((() ()) ((()))))
X(((() () ()) ((() ()))) ((() (())) (((()))) ((()) ())))
X(((() () () ()) ((() () ()))) ((() () (())) ((() (()))) (() (()) ()) (((()) ())) ((()) () ()) (() (() ())) (((() ()))) ((() ()) ())) ((() ((()))) ((((())))) (((())) ()) ((()) (()))))
X(((() () () () ()) ((() () () ()))) ((() () () (())) ((() () (()))) (() () (()) ()) ((() (()) ())) (() (()) () ()) (((()) () ())) ((()) () () ()) (() (() () ())) (((() () ()))) ((() () ()) ())) ((() () (() ())) ((() (() ()))) (() (() ()) ()) (((() ()) ())) ((() ()) () ())) ((() () ((()))) ((() ((())))) (() ((())) ()) ((((())) ())) (((())) () ()) ((()) (() ())) (() ((() ()))) ((((() ())))) (((() ())) ()) ((() ()) (()))) ((() (()) (())) (((()) (()))) ((()) (()) ()) (() ((()) ())) ((((()) ()))) (((()) ()) ()) ((()) () (())) (() (() (()))) (((() (())))) ((() (())) ())) ((() (((())))) (((((()))))) ((((()))) ()) (((())) (())) ((()) ((())))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a057501.sxp failed"
fi
fi
# ============= a057546.sxp ==============
if test -f 'a057546.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a057546.sxp (file already exists)"
else
${echo} "x - extracting a057546.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a057546.sxp' &&
X("A057546 = Fixpoints of A057511/A057512" 10)
X((()))
X(((())))
X(((() ()) ((()))))
X(((() () ()) ((() ())) (((())))))
X(((() () () ()) ((()) (())) ((() () ())) (((() ()))) ((((()))))))
X(((() () () () ()) ((() () () ())) (((()) (()))) (((() () ()))) ((((() ())))) (((((())))))))
X(((() () () () () ()) ((()) (()) (())) ((() ()) (() ())) ((() () () () ())) (((())) ((()))) (((() () () ()))) ((((()) (())))) ((((() () ())))) (((((() ()))))) ((((((()))))))))
X(((() () () () () () ()) ((() () () () () ())) (((()) (()) (()))) (((() ()) (() ()))) (((() () () () ()))) ((((())) ((())))) ((((() () () ())))) (((((()) (()))))) (((((() () ()))))) ((((((() ())))))) (((((((())))))))))
X(((() () () () () () () ()) ((()) (()) (()) (())) ((() () ()) (() () ())) ((() () () () () () ())) ((() (())) ((()) ())) (((()) ()) (() (()))) (((() ())) ((() ()))) (((() () () () () ()))) ((((()))) (((())))) ((((()) (()) (())))) ((((() ()) (() ())))) ((((() () () () ())))) (((((())) ((()))))) (((((() () () ()))))) ((((((()) (())))))) ((((((() () ())))))) (((((((() ()))))))) ((((((((()))))))))))
X(((() () () () () () () () ()) ((() ()) (() ()) (() ())) ((() () () () () () () ())) (((())) ((())) ((()))) (((()) (()) (()) (()))) (((() () ()) (() () ()))) (((() () () () () () ()))) (((() (())) ((()) ()))) ((((()) ()) (() (())))) ((((() ())) ((() ())))) ((((() () () () () ())))) (((((()))) (((()))))) (((((()) (()) (()))))) (((((() ()) (() ()))))) (((((() () () () ()))))) ((((((())) ((())))))) ((((((() () () ())))))) (((((((()) (()))))))) (((((((() () ()))))))) ((((((((() ())))))))) (((((((((())))))))))))
X(((() () () () () () () () () ()) ((()) (()) (()) (()) (())) ((() () () ()) (() () () ())) ((() () () () () () () () ())) ((() (() ())) ((() ()) ())) ((() ((()))) (((())) ())) (((()) (())) ((()) (()))) (((() ()) ()) (() (() ()))) (((() ()) (() ()) (() ()))) (((() () ())) ((() () ()))) (((() () () () () () () ()))) (((() (()))) (((()) ()))) ((((())) ()) (() ((())))) ((((())) ((())) ((())))) ((((()) ())) ((() (())))) ((((()) (()) (()) (())))) ((((() ()))) (((() ())))) ((((() () ()) (() () ())))) ((((() () () () () () ())))) ((((() (())) ((()) ())))) (((((())))) ((((()))))) (((((()) ()) (() (()))))) (((((() ())) ((() ()))))) (((((() () () () () ()))))) ((((((()))) (((())))))) ((((((()) (()) (())))))) ((((((() ()) (() ())))))) ((((((() () () () ())))))) (((((((())) ((()))))))) (((((((() () () ()))))))) ((((((((()) (())))))))) ((((((((() () ())))))))) (((((((((() ()))))))))) ((((((((((()))))))))))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a057546.sxp failed"
fi
fi
# ============= a069771.sxp ==============
if test -f 'a069771.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a069771.sxp (file already exists)"
else
${echo} "x - extracting a069771.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a069771.sxp' &&
X("RotateHandshakes180" 5)
X((()))
X(((())))
X(((() ())) (((()))))
X(((() () ()) ((() ()))) ((() (()))) (((()) ())) ((((())))))
X(((() () () ())) ((() () (())) ((()) () ())) ((() (()) ()) (((() ())))) ((() (() ())) ((() (())))) ((() ((())))) (((()) (()))) (((() ()) ()) (((()) ()))) (((() () ()))) ((((())) ())) (((((()))))))
X(((() () () () ()) ((() () () ()))) ((() () () (())) (((()) () ()))) ((() () (()) ()) (() (() () ()))) ((() () (() ()))) ((() () ((()))) ((()) (() ()))) ((() (()) () ()) ((() () ()) ())) ((() (()) (())) (((()) ()) ())) ((() (() ()) ())) ((() (() (()))) ((()) (()) ())) ((() ((())) ()) ((((() ()))))) ((() ((()) ())) (((() (()))))) ((() ((() ()))) ((() ((()))))) ((() (((()))))) (((()) () () ()) ((() () (())))) (((()) () (())) (((()) (())))) (((()) ((())))) (((() ()) () ())) (((() ()) (())) (((())) () ())) (((() (())) ()) ((((()) ())))) (((() (()) ())) (((() () ())))) (((() (() ())))) ((((())) (()))) ((((() ())) ()) ((((())) ()))) ((((() ()) ()))) (((((()))) ())) ((((((())))))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a069771.sxp failed"
fi
fi
# ============= a069771_upto7.sxp ==============
if test -f 'a069771_upto7.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a069771_upto7.sxp (file already exists)"
else
${echo} "x - extracting a069771_upto7.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a069771_upto7.sxp' &&
X("RotateHandshakes180" 7)
X((()))
X(((())))
X(((() ())) (((()))))
X(((() () ()) ((() ()))) ((() (()))) (((()) ())) ((((())))))
X(((() () () ())) ((() () (())) ((()) () ())) ((() (()) ()) (((() ())))) ((() (() ())) ((() (())))) ((() ((())))) (((()) (()))) (((() ()) ()) (((()) ()))) (((() () ()))) ((((())) ())) (((((()))))))
X(((() () () () ()) ((() () () ()))) ((() () () (())) (((()) () ()))) ((() () (()) ()) (() (() () ()))) ((() () (() ()))) ((() () ((()))) ((()) (() ()))) ((() (()) () ()) ((() () ()) ())) ((() (()) (())) (((()) ()) ())) ((() (() ()) ())) ((() (() (()))) ((()) (()) ())) ((() ((())) ()) ((((() ()))))) ((() ((()) ())) (((() (()))))) ((() ((() ()))) ((() ((()))))) ((() (((()))))) (((()) () () ()) ((() () (())))) (((()) () (())) (((()) (())))) (((()) ((())))) (((() ()) () ())) (((() ()) (())) (((())) () ())) (((() (())) ()) ((((()) ())))) (((() (()) ())) (((() () ())))) (((() (() ())))) ((((())) (()))) ((((() ())) ()) ((((())) ()))) ((((() ()) ()))) (((((()))) ())) ((((((())))))))
X(((() () () () () ())) ((() () () () (())) (() (()) () () ())) ((() () () (()) ()) ((()) () () () ())) ((() () () (() ())) ((() ()) () () ())) ((() () () ((()))) (((())) () () ())) ((() () (()) () ()) (((() () () ())))) ((() () (()) (())) ((((()) () ())))) ((() () (() ()) ()) ((() (() () ())))) ((() () (() () ())) ((() () (() ())))) ((() () (() (()))) (((()) (() ())))) ((() () ((())) ()) (() ((() () ())))) ((() () ((()) ())) (() (() (() ())))) ((() () ((() ())))) ((() () (((())))) ((()) ((() ())))) ((() (()) () (()))) ((() (()) (()) ()) ((()) () () (()))) ((() (()) (() ())) ((() ()) () (()))) ((() (()) ((()))) (((())) () (()))) ((() (() ()) () ()) (((() () ()) ()))) ((() (() ()) (())) ((((()) ()) ()))) ((() (() () ()) ()) ((() (() ()) ()))) ((() (() () () ())) ((() () (()) ()))) ((() (() () (()))) (((()) (()) ()))) ((() (() (())) ()) (() ((() ()) ()))) ((() (() (()) ()))) ((() (() ((())))) ((()) ((()) ()))) ((() ((())) () ()) (((() () ())) ())) ((() ((())) (())) ((((()) ())) ())) ((() ((()) ()) ()) ((() (() ())) ())) ((() ((()) () ())) ((() () (())) ())) ((() ((()) (()))) (((()) (())) ())) ((() ((() ())) ())) ((() ((() (())))) ((()) ((())) ())) ((() (((()))) ()) (((((() ())))))) ((() (((())) ())) ((((() (())))))) ((() (((()) ()))) (((() ((())))))) ((() (((() ())))) ((() (((())))))) ((() ((((())))))) (((()) () (()) ())) (((()) () (() ())) ((() ()) (()) ())) (((()) () ((()))) (((())) (()) ())) (((()) (()) () ()) (((() () (()))))) (((()) (()) (())) ((((()) (()))))) (((()) (() ()) ()) ((() (() (()))))) (((()) (() () ())) ((() () ((()))))) (((()) (() (()))) (((()) ((()))))) (((()) (((()))))) (((() ()) (() ()))) (((() ()) ((()))) (((())) (() ()))) (((() () ()) () ()) (((() ()) () ()))) (((() () ()) (())) ((((())) () ()))) (((() () () ()) ()) ((() (()) () ()))) (((() () () () ()))) (((() () () (()))) (((()) () () ()))) (((() (())) () ()) (((() ()) ()) ())) (((() (())) (())) ((((())) ()) ())) (((() (()) ()) ())) (((() (()) (()))) (((()) () ()) ())) (((() ((()))) ()) (((((()) ()))))) (((() ((())) ())) ((((() () ()))))) (((() ((()) ()))) (((() (() ()))))) (((() ((() ()))))) ((((())) ((())))) ((((()) ()) () ()) (((() ()) (())))) ((((()) ()) (())) ((((())) (())))) ((((()) () (())))) ((((() ())) () ())) ((((() ())) (())) ((((()))) () ())) ((((() (()))) ()) (((((())) ())))) ((((() (())) ())) ((((() ()) ())))) ((((() (()) ())))) (((((()))) (()))) (((((() ()))) ()) (((((()))) ()))) (((((() ())) ()))) ((((((())))) ())) (((((((()))))))))
X(((() () () () () () ()) ((() () () () () ()))) ((() () () () () (())) ((() (()) () () ()))) ((() () () () (()) ()) (((()) () () () ()))) ((() () () () (() ())) (((() ()) () () ()))) ((() () () () ((()))) ((((())) () () ()))) ((() () () (()) () ()) (() (() () () () ()))) ((() () () (()) (())) (() ((()) () () ()))) ((() () () (() ()) ()) (() () (() () () ()))) ((() () () (() () ()))) ((() () () (() (()))) (() (()) (() () ()))) ((() () () ((())) ()) ((()) (() () () ()))) ((() () () ((()) ())) ((()) () (() () ()))) ((() () () ((() ()))) ((() ()) (() () ()))) ((() () () (((())))) (((())) (() () ()))) ((() () (()) () () ()) ((() () () () ()) ())) ((() () (()) () (())) ((() (()) () ()) ())) ((() () (()) (()) ()) (((()) () () ()) ())) ((() () (()) (() ())) (((() ()) () ()) ())) ((() () (()) ((()))) ((((())) () ()) ())) ((() () (() ()) () ()) (() (() () () ()) ())) ((() () (() ()) (())) (() ((()) () ()) ())) ((() () (() () ()) ())) ((() () (() () (()))) (() (()) (() ()) ())) ((() () (() (())) ()) ((()) (() () ()) ())) ((() () (() (()) ())) ((()) () (() ()) ())) ((() () (() (() ()))) ((() ()) (() ()) ())) ((() () (() ((())))) (((())) (() ()) ())) ((() () ((())) () ()) ((((() () () ()))))) ((() () ((())) (())) (((((()) () ()))))) ((() () ((()) ()) ()) (((() (() () ()))))) ((() () ((()) () ())) (((() () (() ()))))) ((() () ((()) (()))) ((((()) (() ()))))) ((() () ((() ())) ()) ((() ((() () ()))))) ((() () ((() ()) ())) ((() (() (() ()))))) ((() () ((() () ()))) ((() () ((() ()))))) ((() () ((() (())))) (((()) ((() ()))))) ((() () (((()))) ()) (() (((() () ()))))) ((() () (((())) ())) (() ((() (() ()))))) ((() () (((()) ()))) (() (() ((() ()))))) ((() () (((() ()))))) ((() () ((((()))))) ((()) (((() ()))))) ((() (()) () () () ()) ((() () () () (())))) ((() (()) () () (())) ((() (()) () (())))) ((() (()) () (()) ()) (((()) () () (())))) ((() (()) () (() ())) (((() ()) () (())))) ((() (()) () ((()))) ((((())) () (())))) ((() (()) (()) () ()) (() (() () () (())))) ((() (()) (()) (())) (() ((()) () (())))) ((() (()) (() (())))) ((() (()) ((())) ()) ((()) (() () (())))) ((() (()) ((()) ())) ((()) () (() (())))) ((() (()) ((() ()))) ((() ()) (() (())))) ((() (()) (((())))) (((())) (() (())))) ((() (() ()) () () ()) ((() () () ()) () ())) ((() (() ()) () (())) ((() (()) ()) () ())) ((() (() ()) (()) ()) (((()) () ()) () ())) ((() (() ()) (() ())) (((() ()) ()) () ())) ((() (() ()) ((()))) ((((())) ()) () ())) ((() (() () ()) () ())) ((() (() () ()) (())) (() ((()) ()) () ())) ((() (() () (())) ()) ((()) (() ()) () ())) ((() (() () (()) ())) ((()) () (()) () ())) ((() (() () (() ()))) ((() ()) (()) () ())) ((() (() () ((())))) (((())) (()) () ())) ((() (() (())) () ()) ((((() () ()) ())))) ((() (() (())) (())) (((((()) ()) ())))) ((() (() (()) ()) ()) (((() (() ()) ())))) ((() (() (()) () ())) (((() () (()) ())))) ((() (() (()) (()))) ((((()) (()) ())))) ((() (() (() ())) ()) ((() ((() ()) ())))) ((() (() (() ()) ())) ((() (() (()) ())))) ((() (() (() () ()))) ((() () ((()) ())))) ((() (() (() (())))) (((()) ((()) ())))) ((() (() ((()))) ()) (() (((() ()) ())))) ((() (() ((())) ())) (() ((() (()) ())))) ((() (() ((()) ())))) ((() (() (((()))))) ((()) (((()) ())))) ((() ((())) () () ()) ((() () () ()) (()))) ((() ((())) () (())) ((() (()) ()) (()))) ((() ((())) (()) ()) (((()) () ()) (()))) ((() ((())) (() ())) (((() ()) ()) (()))) ((() ((())) ((()))) ((((())) ()) (()))) ((() ((()) ()) (()))) ((() ((()) (())) ()) ((()) (() ()) (()))) ((() ((()) (()) ())) ((()) () (()) (()))) ((() ((()) (() ()))) ((() ()) (()) (()))) ((() ((()) ((())))) (((())) (()) (()))) ((() ((() ())) () ()) ((((() () ())) ()))) ((() ((() ())) (())) (((((()) ())) ()))) ((() ((() ()) ()) ()) (((() (() ())) ()))) ((() ((() ()) () ())) (((() () (())) ()))) ((() ((() ()) (()))) ((((()) (())) ()))) ((() ((() () ())) ()) ((() ((() ())) ()))) ((() ((() () ()) ())) ((() (() (())) ()))) ((() ((() () () ()))) ((() () ((())) ()))) ((() ((() () (())))) (((()) ((())) ()))) ((() ((() (()))) ()) (() (((() ())) ()))) ((() ((() (())) ()))) ((() ((() ((()))))) ((()) (((())) ()))) ((() (((()))) () ()) ((((() () ()))) ())) ((() (((()))) (())) (((((()) ()))) ())) ((() (((())) ()) ()) (((() (() ()))) ())) ((() (((())) () ())) (((() () (()))) ())) ((() (((())) (()))) ((((()) (()))) ())) ((() (((()) ())) ()) ((() ((() ()))) ())) ((() (((()) ()) ())) ((() (() (()))) ())) ((() (((()) () ()))) ((() () ((()))) ())) ((() (((()) (())))) (((()) ((()))) ())) ((() (((() ()))) ())) ((() (((() (()))))) ((()) (((()))) ())) ((() ((((())))) ()) ((((((() ()))))))) ((() ((((()))) ())) (((((() (()))))))) ((() ((((())) ()))) ((((() ((()))))))) ((() ((((()) ())))) (((() (((()))))))) ((() ((((() ()))))) ((() ((((()))))))) ((() (((((()))))))) (((()) () () () () ()) ((() () () (()) ()))) (((()) () () () (())) ((() (()) (()) ()))) (((()) () () (()) ()) (((()) () (()) ()))) (((()) () () (() ())) (((() ()) (()) ()))) (((()) () () ((()))) ((((())) (()) ()))) (((()) () ((())) ()) ((()) (() (()) ()))) (((()) () ((()) ()))) (((()) () ((() ()))) ((() ()) ((()) ()))) (((()) () (((())))) (((())) ((()) ()))) (((()) (()) () () ()) ((() () () (())) ())) (((()) (()) () (())) ((() (()) (())) ())) (((()) (()) (()) ()) (((()) () (())) ())) (((()) (()) (() ())) (((() ()) (())) ())) (((()) (()) ((()))) ((((())) (())) ())) (((()) (() (())) ())) (((()) (() (() ()))) ((() ()) ((())) ())) (((()) (() ((())))) (((())) ((())) ())) (((()) ((())) () ()) ((((() () (())))))) (((()) ((())) (())) (((((()) (())))))) (((()) ((()) ()) ()) (((() (() (())))))) (((()) ((()) () ())) (((() () ((())))))) (((()) ((()) (()))) ((((()) ((())))))) (((()) ((() ())) ()) ((() ((() (())))))) (((()) ((() ()) ())) ((() (() ((())))))) (((()) ((() () ()))) ((() () (((())))))) (((()) ((() (())))) (((()) (((())))))) (((()) ((((())))))) (((() ()) () () () ()) ((() () () (() ())))) (((() ()) () () (())) ((() (()) (() ())))) (((() ()) () (()) ()) (((()) () (() ())))) (((() ()) () (() ())) (((() ()) (() ())))) (((() ()) () ((()))) ((((())) (() ())))) (((() ()) ((() ())))) (((() ()) (((())))) (((())) ((() ())))) (((() () ()) () () ())) (((() () ()) () (())) ((() (())) () () ())) (((() () ()) (()) ()) (((()) ()) () () ())) (((() () ()) (() ())) (((() ())) () () ())) (((() () ()) ((()))) ((((()))) () () ())) (((() () () ((())))) (((())) () () () ())) (((() () (())) () ()) ((((() ()) () ())))) (((() () (())) (())) (((((())) () ())))) (((() () (()) ()) ()) (((() (()) () ())))) (((() () (()) () ())) (((() () () () ())))) (((() () (()) (()))) ((((()) () () ())))) (((() () (() ())) ()) ((() ((()) () ())))) (((() () (() ()) ())) ((() (() () () ())))) (((() () (() () ())))) (((() () (() (())))) (((()) (() () ())))) (((() (())) () (()))) (((() (())) (()) ()) (((()) ()) () (()))) (((() (())) (() ())) (((() ())) () (()))) (((() (())) ((()))) ((((()))) () (()))) (((() (()) ((())))) (((())) () () (()))) (((() (() ())) () ()) ((((() ()) ()) ()))) (((() (() ())) (())) (((((())) ()) ()))) (((() (() ()) ()) ()) (((() (()) ()) ()))) (((() (() ()) () ())) (((() () () ()) ()))) (((() (() ()) (()))) ((((()) () ()) ()))) (((() (() () ())) ()) ((() ((()) ()) ()))) (((() (() () ()) ()))) (((() (() () (())))) (((()) (() ()) ()))) (((() ((()))) () ()) ((((() ()) ())) ())) (((() ((()))) (())) (((((())) ())) ())) (((() ((())) ()) ()) (((() (()) ())) ())) (((() ((())) () ())) (((() () () ())) ())) (((() ((())) (()))) ((((()) () ())) ())) (((() ((()) ())) ())) (((() ((()) (())))) (((()) (() ())) ())) (((() (((())))) ()) ((((((()) ())))))) (((() (((()))) ())) (((((() () ())))))) (((() (((())) ()))) ((((() (() ())))))) (((() (((()) ())))) (((() ((() ())))))) (((() (((() ())))))) ((((())) () (()) ()) (((()) () ((()))))) ((((())) () (() ())) (((() ()) ((()))))) ((((())) () ((()))) ((((())) ((()))))) ((((())) (((()))))) ((((()) ()) (()) ())) ((((()) ()) (() ())) (((() ())) (()) ())) ((((()) ()) ((()))) ((((()))) (()) ())) ((((()) (())) () ()) ((((() ()) (()))))) ((((()) (())) (())) (((((())) (()))))) ((((()) (()) ()) ()) (((() (()) (()))))) ((((()) (()) () ())) (((() () () (()))))) ((((()) (()) (()))) ((((()) () (()))))) ((((()) (() (()))))) ((((() ())) (() ()))) ((((() ())) ((()))) ((((()))) (() ()))) ((((() () ())) () ()) (((
X
X(() ())) () ()))) ((((() () ())) (())) (((((()))) () ()))) ((((() () ()) ()) ()) (((() (())) () ()))) ((((() () ()) () ()))) ((((() () ()) (()))) ((((()) ()) () ()))) ((((() (()))) () ()) ((((() ())) ()) ())) ((((() (()))) (())) (((((()))) ()) ())) ((((() (())) ()) ())) ((((() (())) (()))) ((((()) ()) ()) ())) ((((() ((())))) ()) ((((((())) ()))))) ((((() ((()))) ())) (((((() ()) ()))))) ((((() ((())) ()))) ((((() (()) ()))))) ((((() ((()) ()))))) (((((()))) ((())))) (((((()) ())) () ()) ((((() ())) (())))) (((((()) ())) (())) (((((()))) (())))) (((((()) ()) (())))) (((((() ()))) () ())) (((((() ()))) (())) (((((())))) () ())) (((((() (())))) ()) ((((((()))) ())))) (((((() (()))) ())) (((((() ())) ())))) (((((() (())) ())))) ((((((())))) (()))) ((((((() ())))) ()) ((((((())))) ()))) ((((((() ()))) ()))) (((((((()))))) ())) ((((((((())))))))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a069771_upto7.sxp failed"
fi
fi
# ============= a069772.sxp ==============
if test -f 'a069772.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a069772.sxp (file already exists)"
else
${echo} "x - extracting a069772.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a069772.sxp' &&
X("xReflectHandshakes" 5)
X((()))
X(((())))
X(((() ())) (((()))))
X(((() () ()) ((() ()))) ((() (())) ((()) ())) ((((())))))
X(((() () () ())) ((() () (()))) ((() (()) ()) (((() ())))) ((() (() ())) (((()) ()))) ((() ((()))) (((())) ())) (((()) () ())) (((()) (()))) (((() ()) ()) ((() (())))) (((() () ()))) (((((()))))))
X(((() () () () ()) ((() () () ()))) ((() () () (())) ((() () (())))) ((() () (()) ()) ((() () ()) ())) ((() () (() ())) ((() ()) () ())) ((() () ((()))) ((() ()) (()))) ((() (()) () ()) (() (() () ()))) ((() (()) (())) (() (() (())))) ((() (() ()) ())) ((() ((())) ()) ((((() ()))))) ((() ((()) ())) ((((()) ())))) ((() ((() ()))) ((((())) ()))) ((() (((())))) ((((()))) ())) (((()) () () ()) (((()) () ()))) (((()) () (())) (((()) (())))) (((()) (()) ()) (((()) ()) ())) (((()) (() ())) (((())) () ())) (((()) ((()))) (((())) (()))) (((() (())) ()) (((() (()))))) (((() (()) ())) (((() () ())))) (((() (() ()))) (((() ()) ()))) (((() ((())))) (((() ())) ())) ((((((())))))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a069772.sxp failed"
fi
fi
# ============= a071661.sxp ==============
if test -f 'a071661.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a071661.sxp (file already exists)"
else
${echo} "x - extracting a071661.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a071661.sxp' &&
X("A079438 = Fixpoints of A071661/A071662" 18)
X((()))
X(((())))
X(((() ()) ((()))))
X(((() () ()) (((())))))
X(((() () () ()) ((((()))))))
X(((() () () () ()) (((((())))))) ((() (() ()) ()) (((()) (())))))
X(((() () () () () ()) ((((((()))))))) ((() ((() ())) ()) (((()) () (())))))
X(((() () () () () () ()) (((((((())))))))) ((() (((() ()))) ()) (((()) () () (())))))
X(((() () () () () () () ()) ((((((((()))))))))) ((() () (() () ()) () ()) (((((())) ((())))))) ((() ((((() ())))) ()) (((()) () () () (())))))
X(((() () () () () () () () ()) (((((((((())))))))))) ((() () ((() () ())) () ()) (((((())) () ((())))))) ((() (((((() ()))))) ()) (((()) () () () () (())))))
X(((() () () () () () () () () ()) ((((((((((()))))))))))) ((() () (((() () ()))) () ()) (((((())) () () ((())))))) ((() ((((((() ())))))) ()) (((()) () () () () () (())))))
X(((() () () () () () () () () () ()) (((((((((((())))))))))))) ((() () () (() () () ()) () () ()) (((((((()))) (((())))))))) ((() () ((((() () ())))) () ()) (((((())) () () () ((())))))) ((() (((((((() ()))))))) ()) (((()) () () () () () () (())))))
X(((() () () () () () () () () () () ()) ((((((((((((()))))))))))))) ((() () () ((() () () ())) () () ()) (((((((()))) () (((())))))))) ((() () (((((() () ()))))) () ()) (((((())) () () () () ((())))))) ((() ((((((((() ())))))))) ()) (((()) () () () () () () () (())))))
X(((() () () () () () () () () () () () ()) (((((((((((((())))))))))))))) ((() () () (((() () () ()))) () () ()) (((((((()))) () () (((())))))))) ((() () ((((((() () ())))))) () ()) (((((())) () () () () () ((())))))) ((() (((((((((() ()))))))))) ()) (((()) () () () () () () () () (())))))
X(((() () () () () () () () () () () () () ()) ((((((((((((((()))))))))))))))) ((() () () () (() () () () ()) () () () ()) (((((((((())))) ((((())))))))))) ((() () () ((((() () () ())))) () () ()) (((((((()))) () () () (((())))))))) ((() () (((((((() () ()))))))) () ()) (((((())) () () () () () () ((())))))) ((() ((() ()) (() (()) ()) (() ())) ()) (((()) ((() (())) ((()) ())) (())))) ((() ((((((((((() ())))))))))) ()) (((()) () () () () () () () () () (())))))
X(((() () () () () () () () () () () () () () ()) (((((((((((((((())))))))))))))))) ((() () () () ((() () () () ())) () () () ()) (((((((((())))) () ((((())))))))))) ((() () () (((((() () () ()))))) () () ()) (((((((()))) () () () () (((())))))))) ((() () ((((((((() () ())))))))) () ()) (((((())) () () () () () () () ((())))))) ((() ((() ()) ((() (()) ())) (() ())) ()) (((()) ((() (())) () ((()) ())) (())))) ((() (((((((((((() ()))))))))))) ()) (((()) () () () () () () () () () () (())))))
X(((() () () () () () () () () () () () () () () ()) ((((((((((((((((()))))))))))))))))) ((() () () () (((() () () () ()))) () () () ()) (((((((((())))) () () ((((())))))))))) ((() () () ((((((() () () ())))))) () () ()) (((((((()))) () () () () () (((())))))))) ((() () (((((((((() () ()))))))))) () ()) (((((())) () () () () () () () () ((())))))) ((() ((() ()) (((() (()) ()))) (() ())) ()) (((()) ((() (())) () () ((()) ())) (())))) ((() ((((((((((((() ())))))))))))) ()) (((()) () () () () () () () () () () () (())))))
X(((() () () () () () () () () () () () () () () () ()) (((((((((((((((((())))))))))))))))))) ((() () () () () (() () () () () ()) () () () () ()) (((((((((((()))))) (((((())))))))))))) ((() () () () ((((() () () () ())))) () () () ()) (((((((((())))) () () () ((((())))))))))) ((() () () (((((((() () () ()))))))) () () ()) (((((((()))) () () () () () () (((())))))))) ((() () ((((((((((() () ())))))))))) () ()) (((((())) () () () () () () () () () ((())))))) ((() ((() ()) ((((() (()) ())))) (() ())) ()) (((()) ((() (())) () () () ((()) ())) (())))) ((() (((((((((((((() ()))))))))))))) ()) (((()) () () () () () () () () () () () () (())))))
X(((() () () () () () () () () () () () () () () () () ()) ((((((((((((((((((()))))))))))))))))))) ((() () () () () ((() () () () () ())) () () () () ()) (((((((((((()))))) () (((((())))))))))))) ((() () () () (((((() () () () ()))))) () () () ()) (((((((((())))) () () () () ((((())))))))))) ((() () () ((((((((() () () ())))))))) () () ()) (((((((()))) () () () () () () () (((())))))))) ((() () (((((((((((() () ()))))))))))) () ()) (((((())) () () () () () () () () () () ((())))))) ((() ((() ()) (((((() (()) ()))))) (() ())) ()) (((()) ((() (())) () () () () ((()) ())) (())))) ((() ((((() ())) (() ((())) ()) ((() ())))) ()) (((()) () ((() () (())) ((()) () ())) () (())))) ((() ((((((((((((((() ())))))))))))))) ()) (((()) () () () () () () () () () () () () () (())))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a071661.sxp failed"
fi
fi
# ============= a079442.sxp ==============
if test -f 'a079442.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a079442.sxp (file already exists)"
else
${echo} "x - extracting a079442.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a079442.sxp' &&
X("A079442 = Fixpoints of A071663/A071664" 4)
X(((() (())) ((() ())) ((()) ())))
X(((() () ((()))) (((() () ()))) (((())) () ())) ((() (()) (())) ((() (() ()))) (((()) ()) ())) ((() (() (()))) (((() ()) ())) ((()) (()) ())))
X(((() () () (((())))) ((((() () () ())))) ((((()))) () () ())) ((() () (()) ((()))) (((() (() () ())))) ((((())) ()) () ())) ((() () (() ((())))) ((((() () ()) ()))) (((())) (()) () ())) ((() (()) (()) (())) ((() (() (() ())))) ((((()) ()) ()) ())) ((() (() (() (())))) ((((() ()) ()) ())) ((()) (()) (()) ())) ((() ((())) () (())) ((() () ((() ())))) ((((()) () ())) ())) ((() ((() () (())))) ((((() ())) () ())) ((()) () ((())) ())))
X(((() () () () ((((()))))) (((((() () () () ()))))) (((((())))) () () () ())) ((() () () (()) (((())))) ((((() (() () () ()))))) (((((()))) ()) () () ())) ((() () () (() (((()))))) (((((() () () ()) ())))) ((((()))) (()) () () ())) ((() () (()) (()) ((()))) (((() (() (() () ()))))) (((((())) ()) ()) () ())) ((() () (() (() ((()))))) (((((() () ()) ()) ()))) (((())) (()) (()) () ())) ((() () ((())) () ((()))) (((() () ((() () ()))))) (((((())) () ())) () ())) ((() () ((() () ((()))))) (((((() () ())) () ()))) (((())) () ((())) () ())) ((() (()) () ((())) (())) ((() ((() () (() ()))))) (((((()) ())) () ()) ())) ((() (()) (()) (()) (())) ((() (() (() (() ()))))) (((((()) ()) ()) ()) ())) ((() (() () ((() (()))))) (((((() ()) () ())) ())) ((()) ((())) () (()) ())) ((() (() (() (() (()))))) (((((() ()) ()) ()) ())) ((()) (()) (()) (()) ())) ((() ((())) (()) () (())) ((() () (() ((() ()))))) (((((()) () ()) ())) ())) ((() ((() (() () (()))))) (((((() ())) ()) () ())) ((()) () (()) ((())) ())) ((() (((()))) () () (())) ((() () () (((() ()))))) (((((()) () () ()))) ())) ((() (((() () () (()))))) (((((() ()))) () () ())) ((()) () () (((()))) ())))
X(((() () () () () (((((())))))) ((((((() () () () () ())))))) ((((((()))))) () () () () ())) ((() () () () (()) ((((()))))) (((((() (() () () () ())))))) ((((((())))) ()) () () () ())) ((() () () () (() ((((())))))) ((((((() () () () ()) ()))))) (((((())))) (()) () () () ())) ((() () () (()) (()) (((())))) ((((() (() (() () () ())))))) ((((((()))) ()) ()) () () ())) ((() () () (() (() (((())))))) ((((((() () () ()) ()) ())))) ((((()))) (()) (()) () () ())) ((() () () ((())) () (((())))) ((((() () ((() () () ())))))) ((((((()))) () ())) () () ())) ((() () () ((() () (((())))))) ((((((() () () ())) () ())))) ((((()))) () ((())) () () ())) ((() () (()) () ((())) ((()))) (((() ((() () (() () ())))))) ((((((())) ())) () ()) () ())) ((() () (()) (()) (()) ((()))) (((() (() (() (() () ())))))) ((((((())) ()) ()) ()) () ())) ((() () (() () ((() ((())))))) ((((((() () ()) () ())) ()))) (((())) ((())) () (()) () ())) ((() () (() (() (() ((())))))) ((((((() () ()) ()) ()) ()))) (((())) (()) (()) (()) () ())) ((() () ((())) (()) () ((()))) (((() () (() ((() () ())))))) ((((((())) () ()) ())) () ())) ((() () ((() (() () ((())))))) ((((((() () ())) ()) () ()))) (((())) () (()) ((())) () ())) ((() () (((()))) () () ((()))) (((() () () (((() () ())))))) ((((((())) () () ()))) () ())) ((() () (((() () () ((())))))) ((((((() () ()))) () () ()))) (((())) () () (((()))) () ())) ((() (()) () () (((()))) (())) ((() (((() () () (() ())))))) ((((((()) ()))) () () ()) ())) ((() (()) () (()) ((())) (())) ((() ((() (() () (() ())))))) ((((((()) ())) ()) () ()) ())) ((() (()) (()) (()) (()) (())) ((() (() (() (() (() ())))))) ((((((()) ()) ()) ()) ()) ())) ((() (()) (() (()) (())) (())) ((() ((() (() ())) (() ())))) ((((()) ()) ((()) ()) ()) ())) ((() (()) ((())) () (()) (())) ((() (() () ((() (() ())))))) ((((((()) ()) () ())) ()) ())) ((() (() () () (((() (())))))) ((((((() ()) () () ()))) ())) ((()) (((()))) () () (()) ())) ((() (() () (() ((() (())))))) ((((((() ()) () ()) ())) ())) ((()) ((())) (()) () (()) ())) ((() (() (() (())) (() (())))) ((((() ()) ((() ()) ())) ())) ((()) ((()) (()) ()) (()) ())) ((() (() (() (() (() (())))))) ((((((() ()) ()) ()) ()) ())) ((()) (()) (()) (()) (()) ())) ((() (() ((() () (() (())))))) ((((((() ()) ())) () ()) ())) ((()) (()) () ((())) (()) ())) ((() ((())) () ((())) () (())) ((() () ((() () ((() ())))))) ((((((()) () ())) () ())) ())) ((() ((())) (()) (()) () (())) ((() () (() (() ((() ())))))) ((((((()) () ()) ()) ())) ())) ((() ((() () ((() () (())))))) ((((((() ())) () ())) () ())) ((()) () ((())) () ((())) ())) ((() ((() (() (() () (())))))) ((((((() ())) ()) ()) () ())) ((()) () (()) (()) ((())) ())) ((() (((()))) (()) () () (())) ((() () () (() (((() ())))))) ((((((()) () () ()) ()))) ())) ((() (((() (() () () (())))))) ((((((() ()))) ()) () () ())) ((()) () () (()) (((()))) ())) ((() ((((())))) () () () (())) ((() () () () ((((() ())))))) ((((((()) () () () ())))) ())) ((() ((((() () () () (())))))) ((((((() ())))) () () () ())) ((()) () () () ((((())))) ())))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a079442.sxp failed"
fi
fi
# ============= a080070.sxp ==============
if test -f 'a080070.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a080070.sxp (file already exists)"
else
${echo} "x - extracting a080070.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a080070.sxp' &&
X("A080070 upto the size 33")
X((()))
X(((())))
X(((() ())))
X(((() (()))))
X(((() (()) ())))
X(((() ((()) ()))))
X(((() (()) (() ()))))
X(((() ((()) ()) (()))))
X(((() ((()) (() ())) ())))
X(((() ((()) (() ()) (())))))
X(((() (()) ((() ()) (())) ())))
X(((() (((()) ()) (() (())) ()))))
X(((() (()) ((() (() ())) (()) ()))))
X(((() ((()) ()) ((() (()) (())) ()))))
X(((() ((()) (() ())) (() ((()) ()) ()))))
X(((() ((()) (() ()) (())) ((()) (() ())))))
X(((() ((()) ((() ()) (())) ()) (() ()) (()))))
X(((() (((()) ((() ()) (() (())) ())) (())) ())))
X(((() ((()) (() (() ()) ((() (())) (()) ())) ()))))
X(((() (()) ((() ()) ((()) (())) ((() (()) ()) ())))))
X(((() ((()) ()) ((() (())) (() ()) ()) (() ((()) ())))))
X(((() (((()) (() ())) ((() (()) ()) (()))) (()) (() ()))))
X(((() (((()) (() (() ()) (())) (() ((()) ())) ()) ()) (()))))
X(((() ((()) (() (((() ()) ((()) (())) ()) (()) (() ())))) ())))
X(((() ((()) (() ()) (()) ((() ((() (())) (() ()) ())) ()) (())))))
X(((() (()) ((((() ()) (())) ()) (() (()) ((() (()) ()) (())))) ())))
X(((() (((()) ()) (() (() (() (())) ())) ((()) ()) (() ((()) ())) ()))))
X(((() (()) ((((() (() ())) (()) ((()) (()) ())) (() ())) (()) (() ())))))
X(((() ((()) ()) ((() (() ((() (()) (())) ()) ((() ()) ())) (())) ()) (()))))
X(((() (((()) (() ())) (() ((()) ((()) (() ((()) ()) ())) (() (()))) ())) ())))
X(((() ((()) (() (() ()) (())) ((()) ((() ()) (() ()) ((()) (() ()))) (()) ())))))
X(((() (()) ((() ()) ((()) (())) ()) (((() ()) ((() (())) (())) (() ()) (())) ()))))
X(((() (((()) ()) ((() (())) (() ()) ())) (() (((() (())) (() (()) ()) ()) (())) ()))))
X(((() ((()) (() (() ())) ((() (()) ()) (()))) ((()) (() ((() (()) ()) ((()) ()))) ()))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a080070.sxp failed"
fi
fi
# ============= a080120.sxp ==============
if test -f 'a080120.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a080120.sxp (file already exists)"
else
${echo} "x - extracting a080120.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a080120.sxp' &&
X("http://www.research.att.com/~~njas/sequences/a080120.pdf")
X((()))
X((()()))
X(((()())))
X((()((()))()))
X((()(())(())()))
X(((((()()(())(())()())))))
X(((()(()(((()))()()((())))())())))
X((()(())()(((()))())(()((())))()(())()))
X(((((()(((())()()((())())(()(()))()()(())))())))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a080120.sxp failed"
fi
fi
# ============= a080974.sxp ==============
if test -f 'a080974.sxp' && test "$first_param" != -c; then
${echo} "x - SKIPPING a080974.sxp (file already exists)"
else
${echo} "x - extracting a080974.sxp (text)"
  sed 's/^X//' << 'SHAR_EOF' > 'a080974.sxp' &&
X("http://oeis.org/A080973/a080973.pdf")
X(((())))
X((((() ()))))
X(((((() ()) (() ())))))
X((((((() ()) ()) (() (() ()))))))
X(((((((() ()) (() ())) ()) (() ((() ()) (() ())))))))
X(((((((() ()) (() (() ()))) ()) (() (((() ()) ()) (() ())))))))
X((((((((() ()) (() ())) (() (() ()))) ()) (() (((() ()) ()) ((() ()) (() ()))))))))
X(((((((((() ()) ()) (() (() ()))) (() (() ()))) ()) (() (((() ()) ()) (((() ()) ()) (() (() ())))))))))
X((((((((((() ()) (() ())) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() ((() ()) (() ()))))))))))
X((((((((((() ()) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) (() ()))))))))))
X(((((((((((() ()) (() ())) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) ((() ()) (() ())))))))))))
X((((((((((((() ()) ()) (() (() ()))) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) (((() ()) ()) (() (() ()))))))))))))
X(((((((((((((() ()) (() ())) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() ((() ()) (() ())))))))))))))
X(((((((((((((() ()) (() (() ()))) ()) (() (((() ()) ()) (() ())))) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) ((((() ()) (() (() ()))) ()) (() (((() ()) ()) (() ())))))))))))))
X((((((((((((((() ()) (() ())) (() (() ()))) ()) (() (((() ()) ()) ((() ()) (() ()))))) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) (((((() ()) (() ())) (() (() ()))) ()) (() (((() ()) ()) ((() ()) (() ()))))))))))))))
X(((((((((((((((() ()) ()) (() (() ()))) (() (() ()))) ()) (() (((() ()) ()) (((() ()) ()) (() (() ())))))) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) ((((((() ()) ()) (() (() ()))) (() (() ()))) ()) (() (((() ()) ()) (((() ()) ()) (() (() ())))))))))))))))
X((((((((((((((((() ()) (() ())) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() ((() ()) (() ()))))))) (() (() ()))) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() (((() ()) ()) (((((((() ()) (() ())) ()) (() ((() ()) (() ())))) (() (() ()))) ()) (() (((() ()) ()) ((((() ()) (() ())) ()) (() ((() ()) (() ()))))))))))))))))
SHAR_EOF
:
if test $? -ne 0
then ${echo} "restore of a080974.sxp failed"
fi
fi
if rm -fr ${lock_dir}
then ${echo} "x - removed lock directory ${lock_dir}."
else ${echo} "x - failed to remove lock directory ${lock_dir}."
     exit 1
fi
exit 0
